[vlc-devel] [PATCH 08/41] vout:win32: clean the window position check

Steve Lhomme robux4 at ycbcr.xyz
Fri Mar 22 16:13:46 CET 2019


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

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index c14ce7ba73..4865a28580 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -146,7 +146,7 @@ static void UpdateRectsInternal(vout_display_t *vd, bool is_forced)
 #define rect_dest_clipped sys->area.rect_dest_clipped
 
     RECT  rect;
-    POINT point = { 0 };
+    POINT window_pos = { 0 };
 
     /* */
     const vout_display_cfg_t *cfg = &sys->area.vdcfg;
@@ -179,10 +179,10 @@ static void UpdateRectsInternal(vout_display_t *vd, bool is_forced)
     else
     {
         /* Retrieve the window position */
-        ClientToScreen(sys->hwnd, &point);
+        ClientToScreen(sys->hwnd, &window_pos);
 
         EventThreadUpdateWindowPosition(sys->event, &moved_or_resized,
-                                        point.x, point.y,
+                                        &window_pos,
                                         rect.right, rect.bottom);
     }
 #endif
@@ -224,9 +224,9 @@ static void UpdateRectsInternal(vout_display_t *vd, bool is_forced)
     rect_dest.top = 0;
     rect_dest.bottom = place.height;
 #else
-    rect_dest.left = point.x + place.x;
+    rect_dest.left = window_pos.x + place.x;
     rect_dest.right = rect_dest.left + place.width;
-    rect_dest.top = point.y + place.y;
+    rect_dest.top = window_pos.y + place.y;
     rect_dest.bottom = rect_dest.top + place.height;
 #endif
 
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index e72d822aa7..081b4c1450 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -415,14 +415,14 @@ int EventThreadGetWindowStyle( event_thread_t *p_event )
 
 void EventThreadUpdateWindowPosition( event_thread_t *p_event,
                                       bool *pb_moved_or_resized,
-                                      int x, int y, unsigned w, unsigned h )
+                                      const POINT *pos, unsigned w, unsigned h )
 {
     vlc_mutex_lock( &p_event->lock );
-    *pb_moved_or_resized   = x != p_event->x || y != p_event->y ||
+    *pb_moved_or_resized   = pos->x != p_event->x || pos->y != p_event->y ||
                              w != p_event->width || h != p_event->height;
 
-    p_event->x      = x;
-    p_event->y      = y;
+    p_event->x      = pos->x;
+    p_event->y      = pos->y;
     p_event->width  = w;
     p_event->height = h;
     vlc_mutex_unlock( &p_event->lock );
diff --git a/modules/video_output/win32/events.h b/modules/video_output/win32/events.h
index 859c712ff4..fa399ab922 100644
--- a/modules/video_output/win32/events.h
+++ b/modules/video_output/win32/events.h
@@ -53,7 +53,7 @@ void            EventThreadStop( event_thread_t * );
 void            EventThreadUpdateTitle( event_thread_t *, const char *psz_fallback );
 int             EventThreadGetWindowStyle( event_thread_t * );
 void            EventThreadUpdateWindowPosition( event_thread_t *, bool *pb_moved_or_resized,
-                                                 int x, int y, unsigned w, unsigned h );
+                                                 const POINT *window_pos, unsigned w, unsigned h );
 void            EventThreadUpdateSourceAndPlace( event_thread_t *p_event,
                                                  const video_format_t *p_source,
                                                  const vout_display_place_t *p_place );
-- 
2.17.1



More information about the vlc-devel mailing list