[vlc-commits] vout:win32: remove dead video placement code in the mouse handler

Steve Lhomme git at videolan.org
Thu Apr 4 12:30:54 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Apr  4 11:21:20 2019 +0200| [1a74955a0b22e51a52a9bab6a7ffde3068916520] | committer: Steve Lhomme

vout:win32: remove dead video placement code in the mouse handler

Since we don't handle mouse events in video HWND we don't need to translate the
position of the mouse in the parent window coordinates so we don't need the
place of the video HWND anymore (and it could be found using MapWindowPoints).

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

 modules/video_output/win32/common.c |  2 --
 modules/video_output/win32/events.c | 24 ------------------------
 modules/video_output/win32/events.h |  3 ---
 3 files changed, 29 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 693aae6750..b9d1c69fee 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -177,8 +177,6 @@ void UpdateRects(vout_display_t *vd, display_win32_area_t *area, vout_display_sy
 #if !VLC_WINSTORE_APP
         if (sys->event != NULL)
         {
-            EventThreadUpdatePlace(sys->event, &area->place);
-
             if (sys->hvideownd)
             {
                 UINT swpFlags = SWP_NOCOPYBITS | SWP_NOZORDER | SWP_ASYNCWINDOWPOS;
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index 2f7c755a5b..985e95008d 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -80,7 +80,6 @@ struct event_thread_t
     HWND hparent;
     HWND hwnd;
     HWND hvideownd;
-    vout_display_place_t place;
 };
 
 /***************************
@@ -196,15 +195,6 @@ static void *EventThread( void *p_this )
             {
                 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 += p_event->place.x;
-                    y += p_event->place.y;
-                    vlc_mutex_unlock( &p_event->lock );
-                }
                 vout_window_ReportMouseMoved(p_event->parent_window, x, y);
             }
             break;
@@ -290,14 +280,6 @@ static void *EventThread( void *p_this )
     return NULL;
 }
 
-void EventThreadUpdatePlace( event_thread_t *p_event,
-                                      const vout_display_place_t *p_place )
-{
-    vlc_mutex_lock( &p_event->lock );
-    p_event->place  = *p_place;
-    vlc_mutex_unlock( &p_event->lock );
-}
-
 event_thread_t *EventThreadCreate( vlc_object_t *obj, vout_window_t *parent_window)
 {
     if (parent_window->type != VOUT_WINDOW_TYPE_HWND)
@@ -325,12 +307,6 @@ event_thread_t *EventThreadCreate( vlc_object_t *obj, vout_window_t *parent_wind
     p_event->button_pressed = 0;
     p_event->hwnd = NULL;
 
-    /* initialized to 0 to match the init in the display_win32_area_t */
-    p_event->place.x = 0;
-    p_event->place.y = 0;
-    p_event->place.width = 0;
-    p_event->place.height = 0;
-
     _snwprintf( p_event->class_main, ARRAYSIZE(p_event->class_main),
                TEXT("VLC video main %p"), (void *)p_event );
     _snwprintf( p_event->class_video, ARRAYSIZE(p_event->class_video),
diff --git a/modules/video_output/win32/events.h b/modules/video_output/win32/events.h
index 752761f01b..f2cc2adeb0 100644
--- a/modules/video_output/win32/events.h
+++ b/modules/video_output/win32/events.h
@@ -46,6 +46,3 @@ event_thread_t *EventThreadCreate( vlc_object_t *, vout_window_t *);
 void            EventThreadDestroy( event_thread_t * );
 int             EventThreadStart( event_thread_t *, event_hwnd_t *, const event_cfg_t * );
 void            EventThreadStop( event_thread_t * );
-
-void            EventThreadUpdatePlace( event_thread_t *p_event,
-                                        const vout_display_place_t *p_place );



More information about the vlc-commits mailing list