Cosmetics (msw).
authorLaurent Aimar <fenrir@videolan.org>
Sat, 26 Dec 2009 19:21:52 +0000 (20:21 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 5 Jan 2010 20:06:31 +0000 (21:06 +0100)
modules/video_output/msw/common.c
modules/video_output/msw/events.c
modules/video_output/msw/events.h

index 196af7f..d78a4ae 100644 (file)
@@ -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;
index fbe539e..36e10a3 100644 (file)
@@ -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;
index 80eb9b6..43828f4 100644 (file)
@@ -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,