[MPlayer-dev-eng] [PATCH] libvo/x11_common: resize window before mapping it.

Nicolas George nicolas.george at normalesup.org
Wed Feb 6 17:17:00 CET 2013


If the window is resized before being mapped, then the
original size is visible for a fraction of a second.
It happens with the temporary 320×200 window used by vo_gl
to determine the display capabilities and causes bad window
placement decisions from window-managers.
---
 libvo/x11_common.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 03b708f..cac36f1 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -1141,6 +1141,18 @@ void vo_x11_create_vo_window(XVisualInfo *vis, int x, int y,
   XStoreName(mDisplay, vo_window, title);
   XChangeProperty(mDisplay, vo_window, XA_NET_WM_NAME, XAUTF8_STRING,
                   8, PropModeReplace, title, strlen(title));
+  if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
+  if (!geometry_xy_changed)
+    vo_x11_update_geometry();
+  vo_x11_nofs_sizepos(vo_dx, vo_dy, width, height);
+  if (!!vo_fs != !!(flags & VOFLAG_FULLSCREEN))
+    vo_x11_fullscreen();
+  else if (vo_fs) {
+    // if we are already in fullscreen do not switch back and forth, just
+    // set the size values right.
+    vo_dwidth  = vo_screenwidth;
+    vo_dheight = vo_screenheight;
+  }
   if (window_state & VOFLAG_HIDDEN) {
     XSizeHints hint;
     XEvent xev;
@@ -1168,18 +1180,6 @@ void vo_x11_create_vo_window(XVisualInfo *vis, int x, int y,
           StructureNotifyMask | KeyPressMask | KeyReleaseMask | PointerMotionMask |
           ButtonPressMask | ButtonReleaseMask | ExposureMask);
   }
-  if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
-  if (!geometry_xy_changed)
-    vo_x11_update_geometry();
-  vo_x11_nofs_sizepos(vo_dx, vo_dy, width, height);
-  if (!!vo_fs != !!(flags & VOFLAG_FULLSCREEN))
-    vo_x11_fullscreen();
-  else if (vo_fs) {
-    // if we are already in fullscreen do not switch back and forth, just
-    // set the size values right.
-    vo_dwidth  = vo_screenwidth;
-    vo_dheight = vo_screenheight;
-  }
 final:
   if (vo_gc != None)
     XFreeGC(mDisplay, vo_gc);
-- 
1.7.10.4



More information about the MPlayer-dev-eng mailing list