changeset 18715:30d7ddf08889

Fix window position when changing videos while in fullscreen and for window managers that modify position on Map. Oked by Alexander Strasser.
author reimar
date Thu, 15 Jun 2006 08:00:37 +0000
parents 8fc996a3b4e1
children e75ab7767078
files libvo/vo_x11.c libvo/vo_xmga.c libvo/vo_xv.c libvo/vo_xvidix.c libvo/vo_xvmc.c libvo/x11_common.c
diffstat 6 files changed, 15 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_x11.c	Wed Jun 14 22:22:34 2006 +0000
+++ b/libvo/vo_x11.c	Thu Jun 15 08:00:37 2006 +0000
@@ -424,11 +424,11 @@
                 while (xev.type != MapNotify
                        || xev.xmap.event != vo_window);
 
+                vo_x11_nofs_sizepos(vo_dx, vo_dy, vo_dwidth, vo_dheight);
                 if (fullscreen)
                     vo_x11_fullscreen();
-            } else if (!fullscreen)
-                XMoveResizeWindow(mDisplay, vo_window, vo_dx, vo_dy,
-                                  vo_dwidth, vo_dheight);
+            } else
+                vo_x11_nofs_sizepos(vo_dx, vo_dy, vo_dwidth, vo_dheight);
         }
 
         XSync(mDisplay, False);
--- a/libvo/vo_xmga.c	Wed Jun 14 22:22:34 2006 +0000
+++ b/libvo/vo_xmga.c	Thu Jun 15 08:00:37 2006 +0000
@@ -238,13 +238,13 @@
 
                 XStoreName(mDisplay, vo_window, mTitle);
                 XMapWindow(mDisplay, vo_window);
+                vo_x11_nofs_sizepos(vo_dx, vo_dy, vo_dwidth, vo_dheight);
 
                 if (flags & VOFLAG_FULLSCREEN)
                     vo_x11_fullscreen();
 
-            } else if (!(flags & VOFLAG_FULLSCREEN))
-                XMoveResizeWindow(mDisplay, vo_window, vo_dx, vo_dy,
-                                  vo_dwidth, vo_dheight);
+            } else
+                vo_x11_nofs_sizepos(vo_dx, vo_dy, vo_dwidth, vo_dheight);
         }
 
         if (vo_gc != None)
--- a/libvo/vo_xv.c	Wed Jun 14 22:22:34 2006 +0000
+++ b/libvo/vo_xv.c	Thu Jun 15 08:00:37 2006 +0000
@@ -348,15 +348,14 @@
                                    NULL, 0, &hint);
             vo_x11_sizehint(hint.x, hint.y, hint.width, hint.height, 0);
             XMapWindow(mDisplay, vo_window);
+            vo_x11_nofs_sizepos(hint.x, hint.y, hint.width, hint.height);
             if (flags & VOFLAG_FULLSCREEN)
                 vo_x11_fullscreen();
         } else
         {
             // vo_fs set means we were already at fullscreen
             vo_x11_sizehint(hint.x, hint.y, hint.width, hint.height, 0);
-            if (!vo_fs)
-                XMoveResizeWindow(mDisplay, vo_window, hint.x, hint.y,
-                                  hint.width, hint.height);
+            vo_x11_nofs_sizepos(hint.x, hint.y, hint.width, hint.height);
             if (flags & VOFLAG_FULLSCREEN && !vo_fs)
                 vo_x11_fullscreen();    // handle -fs on non-first file
         }
--- a/libvo/vo_xvidix.c	Wed Jun 14 22:22:34 2006 +0000
+++ b/libvo/vo_xvidix.c	Thu Jun 15 08:00:37 2006 +0000
@@ -367,13 +367,13 @@
 
                 XStoreName(mDisplay, vo_window, title);
                 XMapWindow(mDisplay, vo_window);
+                vo_x11_nofs_sizepos(vo_dx, vo_dy, vo_dwidth, vo_dheight);
 
                 if (flags & VOFLAG_FULLSCREEN)
                     vo_x11_fullscreen();
 
-            } else if (!(flags & VOFLAG_FULLSCREEN))
-                XMoveResizeWindow(mDisplay, vo_window, vo_dx, vo_dy,
-                                  vo_dwidth, vo_dheight);
+            } else
+                vo_x11_nofs_sizepos(vo_dx, vo_dy, vo_dwidth, vo_dheight);
         }
 
         if (vo_gc != None)
--- a/libvo/vo_xvmc.c	Wed Jun 14 22:22:34 2006 +0000
+++ b/libvo/vo_xvmc.c	Thu Jun 15 08:00:37 2006 +0000
@@ -701,6 +701,7 @@
          XSetStandardProperties(mDisplay, vo_window, hello, hello, None, NULL, 0, &hint);
          XSetWMNormalHints( mDisplay,vo_window,&hint );
 	 XMapWindow(mDisplay, vo_window);
+	 vo_x11_nofs_sizepos(hint.x, hint.y, hint.width, hint.height);
 	 if ( flags&VOFLAG_FULLSCREEN ) vo_x11_fullscreen();
 	 else {
 	    vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );
@@ -708,7 +709,7 @@
       } else {
 	// vo_fs set means we were already at fullscreen
 	 vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );
-	 if ( !vo_fs ) XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height );
+	 vo_x11_nofs_sizepos(hint.x, hint.y, hint.width, hint.height);
 	 if ( flags&VOFLAG_FULLSCREEN && !vo_fs ) vo_x11_fullscreen(); // handle -fs on non-first file
       }
 
--- a/libvo/x11_common.c	Wed Jun 14 22:22:34 2006 +0000
+++ b/libvo/x11_common.c	Thu Jun 15 08:00:37 2006 +0000
@@ -1512,6 +1512,8 @@
         vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
 
     XMapRaised(mDisplay, vo_window);
+    if ( ! (vo_fs_type & vo_wm_FULLSCREEN) ) // some WMs change window pos on map
+        XMoveResizeWindow(mDisplay, vo_window, x, y, w, h);
     XRaiseWindow(mDisplay, vo_window);
     XFlush(mDisplay);
 }