[vlc-commits] qt: fix mouve move events in video widget with hi-dpi

Pierre Lamot git at videolan.org
Wed Jan 17 18:15:22 CET 2018


vlc/vlc-3.0 | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Jan 17 15:10:15 2018 +0100| [2e01f3ba021bf7ee13835527eb09d93fb1aaf340] | committer: Jean-Baptiste Kempf

qt: fix mouve move events in video widget with hi-dpi

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 2b345618549fef04a05b2cd5c61163a7238b98b3)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt/components/interface_widgets.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/components/interface_widgets.cpp b/modules/gui/qt/components/interface_widgets.cpp
index 98dfdebfbe..d035734f2e 100644
--- a/modules/gui/qt/components/interface_widgets.cpp
+++ b/modules/gui/qt/components/interface_widgets.cpp
@@ -342,7 +342,14 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event )
 {
     if( p_window != NULL )
     {
-        vout_window_ReportMouseMoved( p_window, event->x(), event->y() );
+        QPointF current_pos = event->localPos();
+
+#if HAS_QT56
+        current_pos *= devicePixelRatioF();
+#else
+        current_pos *= devicePixelRatio();
+#endif
+        vout_window_ReportMouseMoved( p_window, current_pos.x(), current_pos.y() );
         event->accept();
     }
     else



More information about the vlc-commits mailing list