Mercurial > mplayer.hg
comparison libvo/x11_common.c @ 8676:579405800083
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>
author | arpi |
---|---|
date | Tue, 31 Dec 2002 12:42:14 +0000 |
parents | fd398a0b4b3b |
children | 604f0cde816c |
comparison
equal
deleted
inserted
replaced
8675:54c386615a70 | 8676:579405800083 |
---|---|
153 int i; | 153 int i; |
154 int wm = vo_wm_Unknown; | 154 int wm = vo_wm_Unknown; |
155 int format; | 155 int format; |
156 unsigned long nitems, bytesafter; | 156 unsigned long nitems, bytesafter; |
157 Atom * args = NULL; | 157 Atom * args = NULL; |
158 int icewm_hack = 0; | |
159 int metacity_hack = 0; | |
160 char * name; | |
158 | 161 |
159 if ( WinID >= 0 ) return vo_wm_Unknown; | 162 if ( WinID >= 0 ) return vo_wm_Unknown; |
160 | 163 |
161 // -- supports layers | 164 // -- supports layers |
162 type=XInternAtom( mDisplay,"_WIN_PROTOCOLS",False ); | 165 type=XInternAtom( mDisplay,"_WIN_PROTOCOLS",False ); |
163 if ( Success == XGetWindowProperty( mDisplay,mRootWin,type,0,16384,False,AnyPropertyType,&type,&format,&nitems,&bytesafter,(unsigned char **) &args ) && nitems > 0 ) | 166 if ( Success == XGetWindowProperty( mDisplay,mRootWin,type,0,16384,False,AnyPropertyType,&type,&format,&nitems,&bytesafter,(unsigned char **) &args ) && nitems > 0 ) |
164 { | 167 { |
165 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm supports layers.\n" ); | 168 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm supports layers.\n" ); |
166 for (i = 0; i < nitems; i++) | 169 for (i = 0; i < nitems; i++) |
167 if (!strcmp( XGetAtomName (mDisplay, args[i]), "_WIN_LAYER")) | 170 { |
168 { | 171 name = XGetAtomName (mDisplay, args[i]); |
169 XFree( args ); | 172 if (!strncmp( name, "_WIN_LAYER", 10)) |
170 return vo_wm_Layered; | 173 wm = vo_wm_Layered; |
171 } | 174 if (!strncmp( name, "_ICEWM_TRAY", 11)) |
175 icewm_hack = 1; | |
176 if (!strncmp( name, "_WIN_HINTS", 10)) | |
177 // metacity is the only manager which supports _WIN_LAYER but not _WIN_HINTS | |
178 metacity_hack = 1; | |
179 } | |
172 XFree( args ); | 180 XFree( args ); |
181 if (wm && !icewm_hack && metacity_hack) | |
182 return wm; | |
173 } | 183 } |
174 | 184 |
175 // --- netwm | 185 // --- netwm |
176 type=XInternAtom( mDisplay,"_NET_SUPPORTED",False ); | 186 type=XInternAtom( mDisplay,"_NET_SUPPORTED",False ); |
177 if ( Success == XGetWindowProperty( mDisplay,mRootWin,type,0,16384,False,AnyPropertyType,&type,&format,&nitems,&bytesafter,(unsigned char **) &args ) && nitems > 0 ) | 187 if ( Success == XGetWindowProperty( mDisplay,mRootWin,type,0,16384,False,AnyPropertyType,&type,&format,&nitems,&bytesafter,(unsigned char **) &args ) && nitems > 0 ) |
178 { | 188 { |
179 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is of class NetWM.\n" ); | 189 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is of class NetWM.\n" ); |
190 net_wm_support = 0; | |
180 for (i = 0; i < nitems; i++) | 191 for (i = 0; i < nitems; i++) |
181 net_wm_support |= net_wm_support_state_test (XGetAtomName (mDisplay, args[i])); | 192 net_wm_support |= net_wm_support_state_test (XGetAtomName (mDisplay, args[i])); |
182 XFree( args ); | 193 XFree( args ); |
183 if (net_wm_support) | 194 if (net_wm_support) |
184 { | 195 { |
185 // ugly hack for broken OpenBox _NET_WM_STATE_FULLSCREEN support | 196 // ugly hack for broken OpenBox _NET_WM_STATE_FULLSCREEN support |
186 // (in their implementation it only changes internal state of window, nothing more!!!) | 197 // (in their implementation it only changes internal state of window, nothing more!!!) |
187 if (vo_wm_NetWM == SUPPORT_FULLSCREEN) | 198 if (net_wm_support & SUPPORT_FULLSCREEN) |
188 { | 199 { |
189 type=XInternAtom( mDisplay,"_BLACKBOX_PID",False ); | 200 type=XInternAtom( mDisplay,"_BLACKBOX_PID",False ); |
190 if ( Success == XGetWindowProperty( mDisplay,mRootWin,type,0,16384,False,AnyPropertyType,&type,&format,&nitems,&bytesafter,(unsigned char **) &args ) && nitems > 0 ) | 201 if ( Success == XGetWindowProperty( mDisplay,mRootWin,type,0,16384,False,AnyPropertyType,&type,&format,&nitems,&bytesafter,(unsigned char **) &args ) && nitems > 0 ) |
191 { | 202 { |
192 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is a broken OpenBox.\n" ); | 203 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is a broken OpenBox.\n" ); |
195 return vo_wm_Unknown; | 206 return vo_wm_Unknown; |
196 } | 207 } |
197 XFree (args); | 208 XFree (args); |
198 } | 209 } |
199 return vo_wm_NetWM; | 210 return vo_wm_NetWM; |
211 } else | |
212 if (icewm_hack) { | |
213 // Next ugly hack for new IceWM (1.2.x). It supports FULLSCREEN state but doesn't say a word | |
214 // about it. What's more it doesn't accept regular resising, so we have to us _NET_WM_STATE_FULLSCREEN | |
215 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is a broken IceWM.\n" ); | |
216 net_wm_support |= SUPPORT_FULLSCREEN; | |
217 return vo_wm_NetWM; | |
200 } | 218 } |
201 } | 219 } |
202 | 220 |
221 // this is old good IceWM, treat it right | |
222 if (icewm_hack) | |
223 return vo_wm_Layered; | |
224 | |
203 if ( wm == vo_wm_Unknown ) mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Unknown wm type...\n" ); | 225 if ( wm == vo_wm_Unknown ) mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Unknown wm type...\n" ); |
204 return wm; | 226 return wm; |
205 } | 227 } |
206 | 228 |
207 int vo_init( void ) | 229 int vo_init( void ) |