[vlc-devel] [PATCH 4/4] Qt: set proper vout size on hidpi setups
Anatoliy Anischovich
lin.aaa.lin at gmail.com
Sat Aug 6 23:11:57 CEST 2016
---
modules/gui/qt/components/interface_widgets.cpp | 6 ++++++
modules/gui/qt/main_interface.cpp | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/modules/gui/qt/components/interface_widgets.cpp b/modules/gui/qt/components/interface_widgets.cpp
index 740d29f..05a71b5 100644
--- a/modules/gui/qt/components/interface_widgets.cpp
+++ b/modules/gui/qt/components/interface_widgets.cpp
@@ -176,6 +176,12 @@ void VideoWidget::reportSize( int w, int h )
if( !p_window )
return;
+#if HAS_QT56
+ qreal ratio = devicePixelRatioF();
+ w *= ratio;
+ h *= ratio;
+#endif
+
vout_window_ReportSize( p_window, w, h );
}
diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index 5555fda..ff984d6 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -785,6 +785,12 @@ void MainInterface::setVideoSize( int w, int h )
if( isFullScreen() || isMaximized() )
return;
+#if HAS_QT56
+ qreal ratio = devicePixelRatioF();
+ w /= ratio;
+ h /= ratio;
+#endif
+
QRect screen = QApplication::desktop()->availableGeometry();
if( h > screen.height() )
{
--
2.7.3
More information about the vlc-devel
mailing list