[vlc-commits] vout:win32: use a single boolean to know if the display area was moved or resized
Steve Lhomme
git at videolan.org
Mon Apr 1 12:03:32 CEST 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Mar 21 17:17:23 2019 +0100| [5452b649dc93d4b927637be1de2442879b2f3506] | committer: Steve Lhomme
vout:win32: use a single boolean to know if the display area was moved or resized
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5452b649dc93d4b927637be1de2442879b2f3506
---
modules/video_output/win32/common.c | 16 +++++++---------
modules/video_output/win32/events.c | 6 +++---
modules/video_output/win32/events.h | 2 +-
3 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 47b4804e95..4b4757a19d 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -162,29 +162,27 @@ void UpdateRects(vout_display_t *vd, vout_display_sys_win32_t *sys, bool is_forc
}
/* If nothing changed, we can return */
- bool has_moved;
- bool is_resized;
+ bool moved_or_resized;
#if VLC_WINSTORE_APP
- has_moved = false;
- is_resized = rect.right != RECTWidth(sys->rect_display) ||
- rect.bottom != RECTHeight(sys->rect_display);
+ moved_or_resized = rect.right != RECTWidth(sys->rect_display) ||
+ rect.bottom != RECTHeight(sys->rect_display);
sys->rect_display = rect;
#else
if (sys->b_windowless)
{
- has_moved = is_resized = false;
+ moved_or_resized = false;
}
else
{
/* Retrieve the window position */
ClientToScreen(sys->hwnd, &point);
- EventThreadUpdateWindowPosition(sys->event, &has_moved, &is_resized,
+ EventThreadUpdateWindowPosition(sys->event, &moved_or_resized,
point.x, point.y,
rect.right, rect.bottom);
-}
+ }
#endif
- if (!is_forced && !has_moved && !is_resized)
+ if (!is_forced && !moved_or_resized)
return;
/* Update the window position and size */
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index 389a81b7fb..d31162f219 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -411,12 +411,12 @@ int EventThreadGetWindowStyle( event_thread_t *p_event )
}
void EventThreadUpdateWindowPosition( event_thread_t *p_event,
- bool *pb_moved, bool *pb_resized,
+ bool *pb_moved_or_resized,
int x, int y, unsigned w, unsigned h )
{
vlc_mutex_lock( &p_event->lock );
- *pb_moved = x != p_event->x || y != p_event->y;
- *pb_resized = w != p_event->width || h != p_event->height;
+ *pb_moved_or_resized = x != p_event->x || y != p_event->y ||
+ w != p_event->width || h != p_event->height;
p_event->x = x;
p_event->y = y;
diff --git a/modules/video_output/win32/events.h b/modules/video_output/win32/events.h
index 26c51a8691..859c712ff4 100644
--- a/modules/video_output/win32/events.h
+++ b/modules/video_output/win32/events.h
@@ -52,7 +52,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, bool *pb_resized,
+void EventThreadUpdateWindowPosition( event_thread_t *, bool *pb_moved_or_resized,
int x, int y, unsigned w, unsigned h );
void EventThreadUpdateSourceAndPlace( event_thread_t *p_event,
const video_format_t *p_source,
More information about the vlc-commits
mailing list