[vlc-commits] skins2: fix fullscreen wrong size on Windows10 (high DPI)

Erwan Tulou git at videolan.org
Fri Oct 5 00:22:32 CEST 2018


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Thu Oct  4 22:04:34 2018 +0200| [028c89ad19d522976a1523e88f84102e667a7340] | committer: Erwan Tulou

skins2: fix fullscreen wrong size on Windows10 (high DPI)

When setting the scaling factor of Windows10 to something different
from the default 100%, a wrong fullscreen width/height was used.

At init, the skins2 engine is a non DPI-aware process. Since Windows10
expects to rescale in the background, reported sizes are altered.
Then, the skins2 engine launches the qt dialog provider, which makes the
process go from non DPI to DPI aware. As a result, Windows10 stops plans
to rescale, and provides the application with the real sizes.

The patch uses the latest valid sizes whatsoever.

This fixes trac #15349

TODO: As of today, the skins2 engine is seen as DPI aware,
(because of Qt) but nothing is implemented to behave accordingly.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=028c89ad19d522976a1523e88f84102e667a7340
---

 modules/gui/skins2/src/vout_manager.cpp | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/modules/gui/skins2/src/vout_manager.cpp b/modules/gui/skins2/src/vout_manager.cpp
index 44d1dcdd7f..63940f4a31 100644
--- a/modules/gui/skins2/src/vout_manager.cpp
+++ b/modules/gui/skins2/src/vout_manager.cpp
@@ -325,8 +325,6 @@ void VoutManager::onUpdate( Subject<VarBool> &rVariable, void *arg )
 void VoutManager::configureFullscreen( VoutWindow& rWindow )
 {
     int numScr = var_InheritInteger( getIntf(), "qt-fullscreen-screennumber" );
-    int x0 = m_pVoutMainWindow->getTop();
-    int y0 = m_pVoutMainWindow->getLeft();
 
     int x, y, w, h;
     if( numScr >= 0 )
@@ -341,17 +339,14 @@ void VoutManager::configureFullscreen( VoutWindow& rWindow )
         rWindow.getMonitorInfo( &x, &y, &w, &h );
     }
 
-    if( x != x0 || y != y0 )
-    {
-        // move and resize fullscreen
-        m_pVoutMainWindow->move( x, y );
-        m_pVoutMainWindow->resize( w, h );
+    // move and resize fullscreen
+    m_pVoutMainWindow->move( x, y );
+    m_pVoutMainWindow->resize( w, h );
 
-        // ensure the fs controller is also moved
-        if( m_pFscWindow )
-        {
-            m_pFscWindow->moveTo( x, y, w, h );
-        }
+    // ensure the fs controller is also moved
+    if( m_pFscWindow )
+    {
+        m_pFscWindow->moveTo( x, y, w, h );
     }
 
     // place voutWindow within fullscreen



More information about the vlc-commits mailing list