[Mplayer-cvslog] CVS: main/libvo x11_common.c,1.114,1.115
Arpi of Ize
arpi at mplayerhq.hu
Sat Dec 7 02:25:33 CET 2002
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv2215
Modified Files:
x11_common.c
Log Message:
The detection of a NetWM class window manager hints is tested before
the test of a gnome class windomanager hints, since the gnome hints
are outdated and replaced by the newer NetWM specification. Newer
versions of Gnome support this standard, and therefore the test should
be placed before the Gnome test. Windowmaker does not support NetWM
and is checked after the NetWM test. In fact the new code should be
placed also before the test for IceWM. Regarding other WMs such as
KDE, IceWM the change is not tested.
patch by Svante Signell <svante.signell at telia.com>
Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -r1.114 -r1.115
--- x11_common.c 4 Dec 2002 23:31:46 -0000 1.114
+++ x11_common.c 7 Dec 2002 01:25:30 -0000 1.115
@@ -131,7 +131,7 @@
{ mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is IceWM.\n" ); return vo_wm_IceWM; }
if ( !strncmp( name,"_KDE_",5 ) )
{ mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is KDE.\n" ); return vo_wm_KDE; }
- if ( !strncmp( name,"KWM_WIN_DESKTOP",15 ) )
+ if ( !strncmp( name,"KWM_WIN",7 ) )
{ mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is WindowMaker style.\n" ); return vo_wm_WMakerStyle; }
// fprintf(stderr,"[ws] PropertyNotify ( 0x%x ) %s ( 0x%x )\n",win,name,xev.xproperty.atom );
return vo_wm_Unknown;
@@ -635,7 +635,9 @@
#define WIN_LAYER_ONBOTTOM 2
#define WIN_LAYER_NORMAL 4
-#define WIN_LAYER_ONTOP 10
+#define WIN_LAYER_ONTOP 6
+#define WIN_LAYER_ABOVE_DOCK 10
+
void vo_x11_setlayer( int layer )
{
@@ -651,6 +653,7 @@
XClientMessageEvent xev;
memset(&xev, 0, sizeof(xev));
xev.type = ClientMessage;
+ xev.display= mDisplay;
xev.window = vo_window;
xev.message_type = XInternAtom(mDisplay, "_WIN_LAYER", False);
xev.format = 32;
@@ -661,11 +664,28 @@
return;
}
+ type=XInternAtom( mDisplay,"_NET_SUPPORTED",False );
+ if ( Success == XGetWindowProperty( mDisplay,mRootWin,type,0,16384,False,AnyPropertyType,&type,&format,&nitems,&bytesafter,(unsigned char**)(&args) ) && nitems > 0 )
+ {
+ XClientMessageEvent xev;
+ mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] NET style stay on top ( layer %d ).\n",layer );
+ memset( &xev,0,sizeof( xev ) );
+ xev.type=ClientMessage;
+ xev.message_type=XInternAtom( mDisplay,"_NET_WM_STATE",False );
+ xev.display=mDisplay;
+ xev.window=vo_window;
+ xev.format=32;
+ xev.data.l[0]=layer;
+ xev.data.l[1]=XInternAtom( mDisplay,"_NET_WM_STATE_ABOVE",False );
+ XSendEvent( mDisplay,mRootWin,False,SubstructureRedirectMask,(XEvent*)&xev );
+ XFree( args );
+ return;
+ }
+
type=XInternAtom( mDisplay,"_WIN_SUPPORTING_WM_CHECK",False );
if ( Success == XGetWindowProperty( mDisplay,mRootWin,type,0,16384,False,AnyPropertyType,&type,&format,&nitems,&bytesafter,(unsigned char**)(&args) ) && nitems > 0 )
{
XClientMessageEvent xev;
-
mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Gnome style stay on top ( layer %d ).\n",layer );
memset( &xev,0,sizeof( xev ) );
xev.type=ClientMessage;
@@ -676,37 +696,11 @@
{
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;
}
if ( layer ) XRaiseWindow( mDisplay,vo_window );
XSendEvent( mDisplay,mRootWin,False,SubstructureNotifyMask,(XEvent*)&xev );
-
- XFree( args );
- return;
- }
- type=XInternAtom( mDisplay,"_NET_SUPPORTED",False );
- if ( Success == XGetWindowProperty( mDisplay,mRootWin,type,0,16384,False,AnyPropertyType,&type,&format,&nitems,&bytesafter,(unsigned char**)(&args) ) && nitems > 0 )
- {
- XEvent e;
- int i;
-
- mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] NET style stay on top ( layer %d ).\n",layer );
- memset( &e,0,sizeof( e ) );
- e.xclient.type=ClientMessage;
- e.xclient.message_type=XInternAtom( mDisplay,"_NET_WM_STATE",False );
- e.xclient.display=mDisplay;
- e.xclient.window=vo_window;
- e.xclient.format=32;
- e.xclient.data.l[0]=layer;
-
- e.xclient.data.l[1]=XInternAtom( mDisplay,"_NET_WM_STATE_STAYS_ON_TOP",False );
- type=XInternAtom( mDisplay,"_NET_WM_STATE_FULLSCREEN",False );
- for ( i=0;i < nitems;i++ )
- if ( args[i] == type ) { e.xclient.data.l[1]=XInternAtom( mDisplay,"_NET_WM_STATE_FULLSCREEN",False ); break; }
-
- XSendEvent( mDisplay,mRootWin,False,SubstructureRedirectMask,&e );
-
XFree( args );
return;
}
More information about the MPlayer-cvslog
mailing list