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

Pierre Lamot git at videolan.org
Wed Jan 17 18:14:39 CET 2018


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Jan 17 15:10:15 2018 +0100| [2b345618549fef04a05b2cd5c61163a7238b98b3] | 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>

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

 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