[MPlayer-dev-eng] [PATCH] X11 vo_wm_detect() correction and fs mode under wmaker

Sergey Pinaev dfo at antex.ru
Tue Nov 5 14:48:24 CET 2002


hi.
both changes are very small, so i sent both as one patch.
description:
1. current vo_wm_detect() implementation waits for XEvents in
simple "for(i=0; i<25; i++)" type loop and can not get any
events and assume, that window manager is unknown. stupid.
i change it to wait for 25 events. i think its stupid too,
but its works for me (tm).
2. WIN_LAYER_ONTOP is lower than window maker dock (and lower
than gnome panel too, i think), so dockapps and dock himself is
displayed above movie window.

p.s. sorry for my bad english =/

Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.110
diff -u -u -r1.110 x11_common.c
--- x11_common.c	4 Nov 2002 08:21:46 -0000	1.110
+++ x11_common.c	5 Nov 2002 13:28:28 -0000
@@ -147,6 +147,7 @@
  unsigned long   nitems, bytesafter;
  unsigned char * args = NULL;
  char          * name = NULL;
+ Bool            rval;
  
  if ( WinID >= 0 ) return vo_wm_Unknown;
  
@@ -168,7 +169,7 @@
  XMoveWindow( mDisplay,win,vo_screenwidth,vo_screenheight );
  do 
   { 
-   XCheckWindowEvent( mDisplay,win,PropertyChangeMask | StructureNotifyMask,&xev );
+   rval = XCheckWindowEvent( mDisplay,win,PropertyChangeMask | StructureNotifyMask,&xev );
 
    if ( xev.type == PropertyNotify )
     {
@@ -179,7 +180,7 @@
      if ( wm != vo_wm_Unknown ) break;
      XFree( name ); name=NULL;
     }
- } while( c++ < 25 );
+ } while( ( c += rval ? 1 : 0) < 25 );
  if ( name ) XFree( name );
  XUnmapWindow( mDisplay,win );
  XDestroyWindow( mDisplay,win );
@@ -630,6 +631,7 @@
 #define WIN_LAYER_ONBOTTOM               2
 #define WIN_LAYER_NORMAL                 4
 #define WIN_LAYER_ONTOP                  6
+#define WIN_LAYER_ABOVE_DOCK             10
 
 void vo_x11_setlayer( int layer )
 {
@@ -695,7 +697,7 @@
     {
      case -1: xev.data.l[0] = WIN_LAYER_ONBOTTOM; break;
      case  0: xev.data.l[0] = WIN_LAYER_NORMAL;   break;
-     case  1: xev.data.l[0] = WIN_LAYER_ONTOP;    break;
+     case  1: xev.data.l[0] = WIN_LAYER_ABOVE_DOCK; break;
     }
    XSendEvent( mDisplay,mRootWin,False,SubstructureNotifyMask,(XEvent*)&xev );
    if ( layer ) XRaiseWindow( mDisplay,vo_window );

-------------------------------------------------
Sergey Pinaev, dfo at antex.ru, http://dfo.antex.ru/



More information about the MPlayer-dev-eng mailing list