[vlc-commits] vout:win32: only handle the WM_SIZE event

Steve Lhomme git at videolan.org
Mon Apr 1 16:50:18 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Apr  1 14:07:34 2019 +0200| [0a59962c934eaf3e83ef7935ccdb7c833e7943ad] | committer: Steve Lhomme

vout:win32: only handle the WM_SIZE event

We don't care if the window has moved.

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

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

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 67fbe86418..7eaac8ac8e 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -275,8 +275,7 @@ void CommonManage(vout_display_t *vd, vout_display_sys_win32_t *sys)
         }
     }
 
-    /* HasMoved means here resize or move */
-    if (EventThreadGetAndResetHasMoved(sys->event))
+    if (EventThreadGetAndResetSizeChanged(sys->event))
         UpdateRects(vd, sys, false);
 }
 
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index aa97111061..3890787109 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -91,7 +91,7 @@ struct event_thread_t
 
     HICON vlc_icon;
 
-    atomic_bool has_moved;
+    atomic_bool size_changed;
 };
 
 /***************************
@@ -415,9 +415,9 @@ void EventThreadUpdatePlace( event_thread_t *p_event,
     vlc_mutex_unlock( &p_event->lock );
 }
 
-bool EventThreadGetAndResetHasMoved( event_thread_t *p_event )
+bool EventThreadGetAndResetSizeChanged( event_thread_t *p_event )
 {
-    return atomic_exchange(&p_event->has_moved, false);
+    return atomic_exchange(&p_event->size_changed, false);
 }
 
 event_thread_t *EventThreadCreate( vout_display_t *vd, const vout_display_cfg_t *vdcfg)
@@ -447,7 +447,7 @@ event_thread_t *EventThreadCreate( vout_display_t *vd, const vout_display_cfg_t
     p_event->button_pressed = 0;
     p_event->psz_title = NULL;
     p_event->hwnd = NULL;
-    atomic_init(&p_event->has_moved, false);
+    atomic_init(&p_event->size_changed, false);
     vout_display_PlacePicture(&p_event->place, &vd->source, vdcfg);
 
     _sntprintf( p_event->class_main, ARRAYSIZE(p_event->class_main),
@@ -473,7 +473,7 @@ int EventThreadStart( event_thread_t *p_event, event_hwnd_t *p_hwnd, const event
     p_event->window_area.right  = p_cfg->x + p_cfg->width;
     p_event->window_area.bottom = p_cfg->y + p_cfg->height;
 
-    atomic_store(&p_event->has_moved, false);
+    atomic_store(&p_event->size_changed, false);
 
     p_event->b_ready = false;
     p_event->b_done  = false;
@@ -934,8 +934,8 @@ static long FAR PASCAL WinVoutEventProc( HWND hwnd, UINT message,
     switch( message )
     {
 
-    case WM_WINDOWPOSCHANGED:
-        atomic_store(&p_event->has_moved, true);
+    case WM_SIZE:
+        atomic_store(&p_event->size_changed, true);
         return 0;
 
     /* the user wants to close the window */
diff --git a/modules/video_output/win32/events.h b/modules/video_output/win32/events.h
index 8797f673fd..453e0ac7d0 100644
--- a/modules/video_output/win32/events.h
+++ b/modules/video_output/win32/events.h
@@ -54,7 +54,7 @@ void            EventThreadUpdateTitle( event_thread_t *, const char *psz_fallba
 int             EventThreadGetWindowStyle( event_thread_t * );
 void            EventThreadUpdatePlace( event_thread_t *p_event,
                                                  const vout_display_place_t *p_place );
-bool            EventThreadGetAndResetHasMoved( event_thread_t * );
+bool            EventThreadGetAndResetSizeChanged( event_thread_t * );
 
 # ifdef __cplusplus
 extern "C" {



More information about the vlc-commits mailing list