# HG changeset patch # User filon # Date 1042147434 0 # Node ID f84a5237f9141fe0fbb2b5b46c1b20beac64c026 # Parent 561cd856fb18b24494c234cfaaf1b7a25b96004b Remember window layer befor changing it. Works on icemw and fvwm, but not on windowmaker (bug in wmaker...). diff -r 561cd856fb18 -r f84a5237f914 libvo/x11_common.c --- a/libvo/x11_common.c Thu Jan 09 20:53:01 2003 +0000 +++ b/libvo/x11_common.c Thu Jan 09 21:23:54 2003 +0000 @@ -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] );