diff options
author | henry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-14 11:09:06 +0000 |
---|---|---|
committer | henry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-14 11:09:06 +0000 |
commit | 6ab9415443d4ccfd7fbfe7b36c7d81b6175e9d99 (patch) | |
tree | be7a301f41ffd2799ea060476cb7d22ad045e6aa /libvo | |
parent | e4723bc3eb0bbe6b9222ff793e4cc7ac4839dd26 (diff) | |
download | mpv-6ab9415443d4ccfd7fbfe7b36c7d81b6175e9d99.tar.bz2 mpv-6ab9415443d4ccfd7fbfe7b36c7d81b6175e9d99.tar.xz |
use more methods to get the fs window on top
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8446 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/x11_common.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 7133a1a7d2..598e8cebbb 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -641,11 +641,12 @@ void vo_x11_sizehint( int x, int y, int width, int height, int max ) void vo_x11_setlayer( int layer ) { - Atom type; + Atom type,arg1,arg2; int format; unsigned long nitems, bytesafter; Atom * args = NULL; - + int i; + if ( WinID >= 0 ) return; if ( vo_wm_type == vo_wm_IceWM ) @@ -676,13 +677,31 @@ void vo_x11_setlayer( int layer ) xev.window=vo_window; xev.format=32; xev.data.l[0]=layer; -// xev.data.l[1]=XInternAtom( mDisplay,"_NET_WM_STATE_ABOVE",False ); xev.data.l[1]=XInternAtom( mDisplay,"_NET_WM_STATE_STAYS_ON_TOP",False ); XSendEvent( mDisplay,mRootWin,False,SubstructureRedirectMask,(XEvent*)&xev ); + + 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,"_NET_WM_STATE",False ); + arg1=XInternAtom( mDisplay,"_NET_WM_STATE_STAYS_ON_TOP",False ); + arg2=XInternAtom( mDisplay,"_NET_WM_STATE_ABOVE",False ); + if ( Success == XGetWindowProperty( mDisplay,vo_window,type,0,16384,False,AnyPropertyType,&type,&format,&nitems,&bytesafter,(unsigned char**)(&args) ) && nitems > 0 && format == 32) { + for (i = 0; i < nitems; i++) { + if (((Atom)args[i] == arg1) || ((Atom)args[i] == arg2)) return; + } + } + // State was not set, continue with GNOME hints + } + 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 ) { |