[MPlayer-dev-eng] [PATCH] fvwm/KWin fs fix

Alexander Strasser eclipse7 at gmx.net
Fri Jul 9 11:59:10 CEST 2004


This fixes the problems that originated from my ewmh
fs patch, caused by a different handling of the wm's
ewmh fs implementations.

I tested on:
openbox3 ( 3.2 ) 
fvwm ( unstable/cvs )
flwm ( 1.00 )
icewm-lite ( 1.2.13+CVS20040510-1 )
metacity ( 2.6.5 )

And as the title suggests it was also tested on the
problematic KWin version, but just not by me.

Please test on as many wms as you can and report the
results to me: here or in #mplayerdev channel.

  Thanks in advance,
    Alex (beastd)
-------------- next part --------------
Index: libvo/x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.173
diff -u -r1.173 x11_common.c
--- libvo/x11_common.c	14 Jun 2004 04:53:03 -0000	1.173
+++ libvo/x11_common.c	9 Jul 2004 00:50:49 -0000
@@ -78,7 +78,7 @@
 int WinID = -1;
 int vo_mouse_autohide = 0;
 int vo_wm_type = 0;
-static int vo_fs_type = 0;
+int vo_fs_type = 0; // needs to be accessable for Gui X11 code
 static int vo_fs_flip = 0;
 char **vo_fstype_list;
 
@@ -1403,34 +1403,39 @@
     if (vo_fs)
     {
         // fs->win
-        vo_x11_ewmh_fullscreen(_NET_WM_STATE_REMOVE);   // removes fullscreen state if wm supports EWMH
+        if ( ! (vo_fs_type & vo_wm_FULLSCREEN) ) // not needed with EWMH fs
+        {
+            if (vo_dwidth != vo_screenwidth && vo_dheight != vo_screenheight)
+                return;
+            x = vo_old_x;
+            y = vo_old_y;
+            w = vo_old_width;
+            h = vo_old_height;
+	}
 
-        if (vo_dwidth != vo_screenwidth && vo_dheight != vo_screenheight)
-            return;
+        vo_x11_ewmh_fullscreen(_NET_WM_STATE_REMOVE);   // removes fullscreen state if wm supports EWMH
         vo_fs = VO_FALSE;
-        x = vo_old_x;
-        y = vo_old_y;
-        w = vo_old_width;
-        h = vo_old_height;
     } else
     {
         // win->fs
         vo_x11_ewmh_fullscreen(_NET_WM_STATE_ADD);      // sends fullscreen state to be added if wm supports EWMH
 
-        if (vo_old_width &&
-            (vo_dwidth == vo_screenwidth && vo_dwidth != vo_old_width) &&
-            (vo_dheight == vo_screenheight && vo_dheight != vo_old_height))
-            return;
         vo_fs = VO_TRUE;
-        vo_old_x = vo_dx;
-        vo_old_y = vo_dy;
-        vo_old_width = vo_dwidth;
-        vo_old_height = vo_dheight;
-        x = 0;
-        y = 0;
-        w = vo_screenwidth;
-        h = vo_screenheight;
-
+        if ( ! (vo_fs_type & vo_wm_FULLSCREEN) ) // not needed with EWMH fs
+        {
+            if (vo_old_width &&
+                (vo_dwidth == vo_screenwidth && vo_dwidth != vo_old_width) &&
+                (vo_dheight == vo_screenheight && vo_dheight != vo_old_height))
+                return;
+            vo_old_x = vo_dx;
+            vo_old_y = vo_dy;
+            vo_old_width = vo_dwidth;
+            vo_old_height = vo_dheight;
+            x = 0;
+            y = 0;
+            w = vo_screenwidth;
+            h = vo_screenheight;
+        }
     }
     {
         long dummy;
@@ -1448,17 +1453,21 @@
         vo_fs_flip = 1;
     }
 
-    vo_x11_decoration(mDisplay, vo_window, (vo_fs) ? 0 : 1);
-    vo_x11_sizehint(x, y, w, h, 0);
-    vo_x11_setlayer(mDisplay, vo_window, vo_fs);
+    if ( ! (vo_fs_type & vo_wm_FULLSCREEN) ) // not needed with EWMH fs
+    {
+        vo_x11_decoration(mDisplay, vo_window, (vo_fs) ? 0 : 1);
+        vo_x11_sizehint(x, y, w, h, 0);
+        vo_x11_setlayer(mDisplay, vo_window, vo_fs);
 
-    if ((!(vo_fs)) & vo_ontop)
-        vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
+        if ((!(vo_fs)) & vo_ontop)
+            vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
 
-    XMoveResizeWindow(mDisplay, vo_window, x, y, w, h);
+        XMoveResizeWindow(mDisplay, vo_window, x, y, w, h);
+    }
 #ifdef HAVE_XINERAMA
     vo_x11_xinerama_move(mDisplay, vo_window);
 #endif
+
     XMapRaised(mDisplay, vo_window);
     XRaiseWindow(mDisplay, vo_window);
     XFlush(mDisplay);
Index: Gui/wm/ws.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/wm/ws.c,v
retrieving revision 1.74
diff -u -r1.74 ws.c
--- Gui/wm/ws.c	13 Jun 2004 10:53:06 -0000	1.74
+++ Gui/wm/ws.c	9 Jul 2004 00:50:50 -0000
@@ -770,24 +770,32 @@
 
  if ( win->isFullScreen )
   {
-   win->X=win->OldX;
-   win->Y=win->OldY;
-   win->Width=win->OldWidth;
-   win->Height=win->OldHeight;
-   win->isFullScreen=False;
-   decoration=win->Decorations;
+   vo_x11_ewmh_fullscreen( _NET_WM_STATE_REMOVE ); // removes fullscreen state if wm supports EWMH
+   if ( ! (vo_fs_type & vo_wm_FULLSCREEN) ) // shouldn't be needed with EWMH fs
+    {
+     win->X=win->OldX;
+     win->Y=win->OldY;
+     win->Width=win->OldWidth;
+     win->Height=win->OldHeight;     
+     decoration=win->Decorations;
+    }
+
 #ifdef ENABLE_DPMS
    wsScreenSaverOn( wsDisplay );
 #endif
 
-   vo_x11_ewmh_fullscreen( _NET_WM_STATE_REMOVE ); // removes fullscreen state if wm supports EWMH
+   win->isFullScreen=False;
   }
   else
    {
-    win->OldX=win->X; win->OldY=win->Y;
-    win->OldWidth=win->Width; win->OldHeight=win->Height;
-    win->X=wsOrgX; win->Y=wsOrgY;
-    win->Width=wsMaxX; win->Height=wsMaxY;
+    if ( ! (vo_fs_type & vo_wm_FULLSCREEN) ) // shouldn't be needed with EWMH fs
+     {
+      win->OldX=win->X; win->OldY=win->Y;
+      win->OldWidth=win->Width; win->OldHeight=win->Height;
+      win->X=wsOrgX; win->Y=wsOrgY;
+      win->Width=wsMaxX; win->Height=wsMaxY;
+     }
+    
     win->isFullScreen=True;
 #ifdef ENABLE_DPMS
     wsScreenSaverOff( wsDisplay );
@@ -796,15 +804,23 @@
      vo_x11_ewmh_fullscreen( _NET_WM_STATE_ADD ); // adds fullscreen state if wm supports EWMH
    }
 
- vo_x11_decoration( wsDisplay,win->WindowID,decoration );
- vo_x11_sizehint( win->X,win->Y,win->Width,win->Height,0 );
- vo_x11_setlayer( wsDisplay,win->WindowID,win->isFullScreen );
+  if ( ! (vo_fs_type & vo_wm_FULLSCREEN) ) // shouldn't be needed with EWMH fs
+   {
+    vo_x11_decoration( wsDisplay,win->WindowID,decoration );
+    vo_x11_sizehint( win->X,win->Y,win->Width,win->Height,0 );
+    vo_x11_setlayer( wsDisplay,win->WindowID,win->isFullScreen );
 
-if ((!(win->isFullScreen)) & vo_ontop) vo_x11_setlayer(wsDisplay, win->WindowID,1);
+    if ((!(win->isFullScreen)) & vo_ontop) vo_x11_setlayer(wsDisplay, win->WindowID,1);
 
+    XMoveResizeWindow( wsDisplay,win->WindowID,win->X,win->Y,win->Width,win->Height );
+   }
+    
  if ( vo_wm_type == 0 && !(vo_fsmode&16) )
-  XWithdrawWindow( wsDisplay,win->WindowID,wsScreen );
- XMoveResizeWindow( wsDisplay,win->WindowID,win->X,win->Y,win->Width,win->Height );
+  {
+   XWithdrawWindow( wsDisplay,win->WindowID,wsScreen );
+  }
+
+  
  XMapRaised( wsDisplay,win->WindowID );
  XRaiseWindow( wsDisplay,win->WindowID );
  XFlush( wsDisplay );


More information about the MPlayer-dev-eng mailing list