[Mplayer-cvslog] CVS: main/libvo x11_common.c,1.134,1.135
Filip Kalinski CVS
filon at mplayerhq.hu
Thu Jan 9 22:24:17 CET 2003
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv30801/libvo
Modified Files:
x11_common.c
Log Message:
Remember window layer befor changing it.
Works on icemw and fvwm, but not on windowmaker (bug in wmaker...).
Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -r1.134 -r1.135
--- x11_common.c 9 Jan 2003 20:47:14 -0000 1.134
+++ x11_common.c 9 Jan 2003 21:23:54 -0000 1.135
@@ -47,6 +47,8 @@
#define WIN_LAYER_ABOVE_DOCK 10
int ice_layer=WIN_LAYER_ABOVE_DOCK;
+int orig_layer=WIN_LAYER_NORMAL;
+
int stop_xscreensaver=0;
static int dpms_disabled=0;
@@ -693,6 +695,25 @@
XSetWMNormalHints( mDisplay,vo_window,&vo_hint );
}
+int vo_x11_get_gnome_layer (Display * mDisplay, Window win)
+{
+ Atom type;
+ int format;
+ unsigned long nitems;
+ unsigned long bytesafter;
+ unsigned short *args = NULL;
+
+ if (XGetWindowProperty (mDisplay, win, XA_WIN_LAYER, 0, 16384,
+ False, AnyPropertyType, &type, &format, &nitems,
+ &bytesafter, (unsigned char **) &args) == Success
+ && nitems > 0 && args)
+ {
+ mp_msg (MSGT_VO, MSGL_STATUS, "[x11] original window layer is %d.\n", *args);
+ return *args;
+ }
+ return WIN_LAYER_NORMAL;
+}
+
void vo_x11_setlayer( Display * mDisplay,Window vo_window,int layer )
{
if ( WinID >= 0 ) return;
@@ -704,13 +725,16 @@
{ case vo_wm_Layered:
{
XClientMessageEvent xev;
+
+ if (layer) orig_layer=vo_x11_get_gnome_layer( mDisplay, vo_window );
+
memset(&xev, 0, sizeof(xev));
xev.type = ClientMessage;
xev.display= mDisplay;
xev.window = vo_window;
xev.message_type = XA_WIN_LAYER;
xev.format = 32;
- xev.data.l[0] = layer?ice_layer:WIN_LAYER_NORMAL; // if not fullscreen, stay on layer "Normal"
+ xev.data.l[0] = layer?ice_layer:orig_layer; // if not fullscreen, stay on default layer
xev.data.l[1] = CurrentTime;
mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Layered style stay on top ( layer %d ).\n",xev.data.l[0] );
printf( "[x11] Layered style stay on top ( layer %d ).\n",xev.data.l[0] );
More information about the MPlayer-cvslog
mailing list