[vlc-devel] [PATCH 03/11] vout:win32: handle the bool value in VOUT_DISPLAY_HIDE_MOUSE

Steve Lhomme robux4 at videolabs.io
Tue Aug 8 15:22:23 CEST 2017


---
 modules/video_output/win32/common.c | 6 ++++--
 modules/video_output/win32/events.c | 9 +++------
 modules/video_output/win32/events.h | 2 +-
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 59e3411cb6..a3c8c6dfe9 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -718,9 +718,11 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
         return VLC_SUCCESS;
     }
 
-    case VOUT_DISPLAY_HIDE_MOUSE:
-        EventThreadMouseHide(sys->event);
+    case VOUT_DISPLAY_HIDE_MOUSE: {
+        bool hide = va_arg(args, int);
+        EventThreadMouseHide(sys->event, hide);
         return VLC_SUCCESS;
+    }
     case VOUT_DISPLAY_RESET_PICTURES:
         vlc_assert_unreachable();
 #endif
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index d298d4b49d..54857a2f32 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -218,10 +218,6 @@ static void *EventThread( void *p_this )
         {
             UpdateCursor( p_event, true );
         }
-        else if( msg.message == WM_VLC_HIDE_MOUSE )
-        {
-            UpdateCursor( p_event, false );
-        }
 
         /* */
         switch( msg.message )
@@ -251,6 +247,7 @@ static void *EventThread( void *p_this )
             break;
 
         case WM_VLC_HIDE_MOUSE:
+            UpdateCursor( p_event, msg.wParam == 0 );
             break;
 
         case WM_LBUTTONDOWN:
@@ -391,9 +388,9 @@ static void *EventThread( void *p_this )
     return NULL;
 }
 
-void EventThreadMouseHide( event_thread_t *p_event )
+void EventThreadMouseHide( event_thread_t *p_event, bool hide )
 {
-    PostMessage( p_event->hwnd, WM_VLC_HIDE_MOUSE, 0, 0 );
+    PostMessage( p_event->hwnd, WM_VLC_HIDE_MOUSE, hide, 0 );
 }
 
 void EventThreadUpdateTitle( event_thread_t *p_event, const char *psz_fallback )
diff --git a/modules/video_output/win32/events.h b/modules/video_output/win32/events.h
index af1414fcde..8035fe6cf6 100644
--- a/modules/video_output/win32/events.h
+++ b/modules/video_output/win32/events.h
@@ -51,7 +51,7 @@ void            EventThreadDestroy( event_thread_t * );
 int             EventThreadStart( event_thread_t *, event_hwnd_t *, const event_cfg_t * );
 void            EventThreadStop( event_thread_t * );
 
-void            EventThreadMouseHide( event_thread_t * );
+void            EventThreadMouseHide( event_thread_t *, bool );
 void            EventThreadUpdateTitle( event_thread_t *, const char *psz_fallback );
 int             EventThreadGetWindowStyle( event_thread_t * );
 void            EventThreadUpdateWindowPosition( event_thread_t *, bool *pb_moved, bool *pb_resized,
-- 
2.12.1



More information about the vlc-devel mailing list