[vlc-commits] vout:win32: report the mouse movements event if the video has no size

Steve Lhomme git at videolan.org
Tue Apr 2 16:33:14 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Mar 27 14:45:42 2019 +0100| [4cd726d7d550cf9bbe68dda0a6fdf6b42d769dc0] | committer: Steve Lhomme

vout:win32: report the mouse movements event if the video has no size

The mouse position won't be shifted, it's fine.

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

 modules/video_output/win32/events.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index 5ef37d7669..1b875e8bee 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -209,20 +209,17 @@ static void *EventThread( void *p_this )
         switch( msg.message )
         {
         case WM_MOUSEMOVE:
-            vlc_mutex_lock( &p_event->lock );
-            vout_display_place_t place  = p_event->place;
-            vlc_mutex_unlock( &p_event->lock );
-
-            if( place.width > 0 && place.height > 0 )
             {
                 int x = GET_X_LPARAM(msg.lParam);
                 int y = GET_Y_LPARAM(msg.lParam);
 
                 if( msg.hwnd == p_event->hvideownd )
                 {
+                    vlc_mutex_lock( &p_event->lock );
                     /* Child window */
-                    x += place.x;
-                    y += place.y;
+                    x += p_event->place.x;
+                    y += p_event->place.y;
+                    vlc_mutex_unlock( &p_event->lock );
                 }
                 vout_window_ReportMouseMoved(p_event->parent_window, x, y);
             }



More information about the vlc-commits mailing list