Commit 72974fc1 authored by Laurent Aimar's avatar Laurent Aimar

Cosmetics (msw).

parent a00e80ab
......@@ -252,6 +252,12 @@ void UpdateRects(vout_display_t *vd,
RECT rect;
POINT point;
/* */
if (!cfg)
cfg = vd->cfg;
if (!source)
source = &vd->source;
/* Retrieve the window size */
GetClientRect(sys->hwnd, &rect);
......@@ -260,19 +266,14 @@ void UpdateRects(vout_display_t *vd,
ClientToScreen(sys->hwnd, &point);
/* If nothing changed, we can return */
bool has_changed;
EventThreadUpdateWindowPosition(sys->event, &has_changed,
bool has_moved;
bool is_resized;
EventThreadUpdateWindowPosition(sys->event, &has_moved, &is_resized,
point.x, point.y,
rect.right, rect.bottom);
if (!is_forced && !has_changed)
if (!is_forced && !has_moved && !is_resized)
return;
/* */
if (!cfg)
cfg = vd->cfg;
if (!source)
source = &vd->source;
/* Update the window position and size */
vout_display_cfg_t place_cfg = *cfg;
place_cfg.display.width = rect.right;
......
......@@ -927,13 +927,14 @@ int EventThreadGetWindowStyle( event_thread_t *p_event )
return p_event->i_window_style;
}
void EventThreadUpdateWindowPosition( event_thread_t *p_event, bool *pb_changed,
void EventThreadUpdateWindowPosition( event_thread_t *p_event,
bool *pb_moved, bool *pb_resized,
int x, int y, int w, int h )
{
vlc_mutex_lock( &p_event->lock );
*pb_changed = x != p_event->wnd_cfg.x ||
y != p_event->wnd_cfg.y ||
w != p_event->wnd_cfg.width ||
*pb_moved = x != p_event->wnd_cfg.x ||
y != p_event->wnd_cfg.y;
*pb_resized = w != p_event->wnd_cfg.width ||
h != p_event->wnd_cfg.height;
p_event->wnd_cfg.x = x;
......
......@@ -53,7 +53,7 @@ void EventThreadMouseAutoHide( event_thread_t * );
void EventThreadMouseShow( event_thread_t * );
void EventThreadUpdateTitle( event_thread_t *, const char *psz_fallback );
int EventThreadGetWindowStyle( event_thread_t * );
void EventThreadUpdateWindowPosition( event_thread_t *, bool *pb_changed,
void EventThreadUpdateWindowPosition( event_thread_t *, bool *pb_moved, bool *pb_resized,
int x, int y, int w, int h );
void EventThreadUpdateSourceAndPlace( event_thread_t *p_event,
const video_format_t *p_source,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment