vlc | branch: master | Anatoliy Anischovich <[email protected]> | Sat Jun  
3 21:11:24 2017 +0300| [f7b8d2ee8baa1037f39f8046da95249613c0dc05] | committer: 
Hugo Beauzée-Luyssen

qt: fix double resize of video widget on hidpi screen

Signed-off-by: Hugo Beauzée-Luyssen <[email protected]>

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

 modules/gui/qt/main_interface.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/main_interface.cpp 
b/modules/gui/qt/main_interface.cpp
index 561e502d7b..bec22ea53c 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -733,8 +733,16 @@ void MainInterface::getVideoSlot( struct vout_window_t 
*p_wnd,
         showVideo();
 
         /* Ask videoWidget to resize correctly, if we are in normal mode */
-        if( b_autoresize )
+        if( b_autoresize ) {
+#if HAS_QT56
+            qreal factor = videoWidget->devicePixelRatioF();
+
+            i_width = qRound( (qreal) i_width / factor );
+            i_height = qRound( (qreal) i_height / factor );
+#endif
+
             videoWidget->setSize( i_width, i_height );
+        }
     }
 }
 

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to