summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-31 12:42:14 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-12-31 12:42:14 +0000
commit24bdd5e39292622749bfac925a9edafd3aa28d8e (patch)
treec0af99871932b670438a51a8bd708135a18c74e7 /libvo
parent2ee32fa05a800027ee986f2ed9670fa3a2ed37a7 (diff)
downloadmpv-24bdd5e39292622749bfac925a9edafd3aa28d8e.tar.bz2
mpv-24bdd5e39292622749bfac925a9edafd3aa28d8e.tar.xz
I have just installed IceWM 1.2.3 which supports NetWM and has broken
support for resizing. To maximize window we need to use _NET_WM_STATE_FULLSCREEN, but it doesn't tell use that it supports it. New IceWM also doesn't support layers in fullscreen mode, changing it doesn't change window position (again, "-icelayer" doesn't fit well). Also while fixing fvwm metacity got broken again, so there is a new hack or it, and small fix in code for openbox. Now it should work on almost everything. Filip Kalinski <filon@pld.org.pl> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8677 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/x11_common.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 6016ba4ed8..7c674cfa4d 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -155,6 +155,9 @@ int vo_wm_detect( void )
int format;
unsigned long nitems, bytesafter;
Atom * args = NULL;
+ int icewm_hack = 0;
+ int metacity_hack = 0;
+ char * name;
if ( WinID >= 0 ) return vo_wm_Unknown;
@@ -164,12 +167,19 @@ int vo_wm_detect( void )
{
mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm supports layers.\n" );
for (i = 0; i < nitems; i++)
- if (!strcmp( XGetAtomName (mDisplay, args[i]), "_WIN_LAYER"))
- {
- XFree( args );
- return vo_wm_Layered;
- }
+ {
+ name = XGetAtomName (mDisplay, args[i]);
+ if (!strncmp( name, "_WIN_LAYER", 10))
+ wm = vo_wm_Layered;
+ if (!strncmp( name, "_ICEWM_TRAY", 11))
+ icewm_hack = 1;
+ if (!strncmp( name, "_WIN_HINTS", 10))
+ // metacity is the only manager which supports _WIN_LAYER but not _WIN_HINTS
+ metacity_hack = 1;
+ }
XFree( args );
+ if (wm && !icewm_hack && metacity_hack)
+ return wm;
}
// --- netwm
@@ -177,6 +187,7 @@ int vo_wm_detect( void )
if ( Success == XGetWindowProperty( mDisplay,mRootWin,type,0,16384,False,AnyPropertyType,&type,&format,&nitems,&bytesafter,(unsigned char **) &args ) && nitems > 0 )
{
mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is of class NetWM.\n" );
+ net_wm_support = 0;
for (i = 0; i < nitems; i++)
net_wm_support |= net_wm_support_state_test (XGetAtomName (mDisplay, args[i]));
XFree( args );
@@ -184,7 +195,7 @@ int vo_wm_detect( void )
{
// ugly hack for broken OpenBox _NET_WM_STATE_FULLSCREEN support
// (in their implementation it only changes internal state of window, nothing more!!!)
- if (vo_wm_NetWM == SUPPORT_FULLSCREEN)
+ if (net_wm_support & SUPPORT_FULLSCREEN)
{
type=XInternAtom( mDisplay,"_BLACKBOX_PID",False );
if ( Success == XGetWindowProperty( mDisplay,mRootWin,type,0,16384,False,AnyPropertyType,&type,&format,&nitems,&bytesafter,(unsigned char **) &args ) && nitems > 0 )
@@ -197,9 +208,20 @@ int vo_wm_detect( void )
XFree (args);
}
return vo_wm_NetWM;
+ } else
+ if (icewm_hack) {
+ // Next ugly hack for new IceWM (1.2.x). It supports FULLSCREEN state but doesn't say a word
+ // about it. What's more it doesn't accept regular resising, so we have to us _NET_WM_STATE_FULLSCREEN
+ mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is a broken IceWM.\n" );
+ net_wm_support |= SUPPORT_FULLSCREEN;
+ return vo_wm_NetWM;
}
}
+ // this is old good IceWM, treat it right
+ if (icewm_hack)
+ return vo_wm_Layered;
+
if ( wm == vo_wm_Unknown ) mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Unknown wm type...\n" );
return wm;
}