Mercurial > mplayer.hg
comparison libvo/x11_common.c @ 9317:c7f5df43b937
- support command line parameter -fstype, eg. -fstype layer=12,above,fullscreen
- help (-fstype help) also availabible
- support state BELOW (someone may want to use it...) and by -fstype none forcing of
not changing window layer (user request)
- drop icelayer option, it can be set by -fstype layer=<number>
- simplify vo_x11_fullscreen
- fs change code cleanup
author | filon |
---|---|
date | Fri, 07 Feb 2003 19:38:39 +0000 |
parents | 420e2b2f8e5a |
children | 3d5fe5fe4aa9 |
comparison
equal
deleted
inserted
replaced
9316:7a0d466a51a8 | 9317:c7f5df43b937 |
---|---|
13 #include <string.h> | 13 #include <string.h> |
14 #include <unistd.h> | 14 #include <unistd.h> |
15 #include <sys/mman.h> | 15 #include <sys/mman.h> |
16 | 16 |
17 #include "video_out.h" | 17 #include "video_out.h" |
18 #include "help_mp.h" | |
18 | 19 |
19 #include <X11/Xmd.h> | 20 #include <X11/Xmd.h> |
20 #include <X11/Xlib.h> | 21 #include <X11/Xlib.h> |
21 #include <X11/Xutil.h> | 22 #include <X11/Xutil.h> |
22 #include <X11/Xatom.h> | 23 #include <X11/Xatom.h> |
44 #define WIN_LAYER_ONBOTTOM 2 | 45 #define WIN_LAYER_ONBOTTOM 2 |
45 #define WIN_LAYER_NORMAL 4 | 46 #define WIN_LAYER_NORMAL 4 |
46 #define WIN_LAYER_ONTOP 6 | 47 #define WIN_LAYER_ONTOP 6 |
47 #define WIN_LAYER_ABOVE_DOCK 10 | 48 #define WIN_LAYER_ABOVE_DOCK 10 |
48 | 49 |
49 int ice_layer=WIN_LAYER_ABOVE_DOCK; | 50 int fs_layer=WIN_LAYER_ABOVE_DOCK; |
50 int orig_layer=WIN_LAYER_NORMAL; | 51 int orig_layer; |
51 | 52 |
52 int stop_xscreensaver=0; | 53 int stop_xscreensaver=0; |
53 | 54 |
54 static int dpms_disabled=0; | 55 static int dpms_disabled=0; |
55 static int timeout_save=0; | 56 static int timeout_save=0; |
63 int mLocalDisplay; | 64 int mLocalDisplay; |
64 | 65 |
65 /* output window id */ | 66 /* output window id */ |
66 int WinID=-1; | 67 int WinID=-1; |
67 int vo_mouse_autohide = 0; | 68 int vo_mouse_autohide = 0; |
68 int vo_wm_type = -1; | 69 int vo_wm_type = 0; |
70 int vo_fs_type = 0; | |
71 char** vo_fstype_list; | |
69 | 72 |
70 /* if equal to 1 means that WM is a metacity (broken as hell) */ | 73 /* if equal to 1 means that WM is a metacity (broken as hell) */ |
71 int metacity_hack = 0; | 74 int metacity_hack = 0; |
72 | |
73 int net_wm_support = 0; | |
74 | 75 |
75 Atom XA_NET_SUPPORTED; | 76 Atom XA_NET_SUPPORTED; |
76 Atom XA_NET_WM_STATE; | 77 Atom XA_NET_WM_STATE; |
77 Atom XA_NET_WM_STATE_FULLSCREEN; | 78 Atom XA_NET_WM_STATE_FULLSCREEN; |
78 Atom XA_NET_WM_STATE_ABOVE; | 79 Atom XA_NET_WM_STATE_ABOVE; |
79 Atom XA_NET_WM_STATE_STAYS_ON_TOP; | 80 Atom XA_NET_WM_STATE_STAYS_ON_TOP; |
81 Atom XA_NET_WM_STATE_BELOW; | |
80 Atom XA_NET_WM_PID; | 82 Atom XA_NET_WM_PID; |
81 Atom XA_WIN_PROTOCOLS; | 83 Atom XA_WIN_PROTOCOLS; |
82 Atom XA_WIN_LAYER; | 84 Atom XA_WIN_LAYER; |
83 Atom XA_WIN_HINTS; | 85 Atom XA_WIN_HINTS; |
84 Atom XA_BLACKBOX_PID; | 86 Atom XA_BLACKBOX_PID; |
145 abort(); | 147 abort(); |
146 //exit_player("X11 error"); | 148 //exit_player("X11 error"); |
147 #undef MSGLEN | 149 #undef MSGLEN |
148 } | 150 } |
149 | 151 |
152 void fstype_help(void) | |
153 { | |
154 mp_msg(MSGT_VO, MSGL_INFO, MSGTR_AvailableFsType); | |
155 | |
156 mp_msg(MSGT_VO, MSGL_INFO, " %-21s %s\n", "none", "don't set fullscreen window layer"); | |
157 mp_msg(MSGT_VO, MSGL_INFO, " %-21s %s\n", "layer", "use _WIN_LAYER hint with default layer"); | |
158 mp_msg(MSGT_VO, MSGL_INFO, " %-21s %s\n", "layer=<0..15>", "use _WIN_LAYER hint with a given layer number"); | |
159 mp_msg(MSGT_VO, MSGL_INFO, " %-21s %s\n", "above", "use _NETWM_STATE_ABOVE hint if available"); | |
160 mp_msg(MSGT_VO, MSGL_INFO, " %-21s %s\n", "below", "use _NETWM_STATE_BELOW hint if vailable"); | |
161 mp_msg(MSGT_VO, MSGL_INFO, " %-21s %s\n", "fullscreen", "use _NETWM_STATE_FULLSCREEN hint if availale"); | |
162 mp_msg(MSGT_VO, MSGL_INFO, " %-21s %s\n", "stays_on_top", "use _NETWM_STATE_STAYS_ON_TOP hint if available"); | |
163 | |
164 mp_msg(MSGT_VO, MSGL_INFO, MSGTR_DefaultFsType, WIN_LAYER_ABOVE_DOCK); | |
165 } | |
166 | |
150 int net_wm_support_state_test( Atom atom ) | 167 int net_wm_support_state_test( Atom atom ) |
151 { | 168 { |
152 #define NET_WM_STATE_TEST(x) { if (atom == XA_NET_WM_STATE_##x) { mp_dbg( MSGT_VO,MSGL_STATUS, "[x11] Detected wm supports " #x " state.\n" ); return SUPPORT_##x; } } | 169 #define NET_WM_STATE_TEST(x) { if (atom == XA_NET_WM_STATE_##x) { mp_msg( MSGT_VO,MSGL_V, "[x11] Detected wm supports " #x " state.\n" ); return vo_wm_##x; } } |
153 | 170 |
154 NET_WM_STATE_TEST(FULLSCREEN); | 171 NET_WM_STATE_TEST(FULLSCREEN); |
155 NET_WM_STATE_TEST(ABOVE); | 172 NET_WM_STATE_TEST(ABOVE); |
156 NET_WM_STATE_TEST(STAYS_ON_TOP); | 173 NET_WM_STATE_TEST(STAYS_ON_TOP); |
157 return SUPPORT_NONE; | 174 NET_WM_STATE_TEST(BELOW); |
175 return 0; | |
158 } | 176 } |
159 | 177 |
160 int x11_get_property(Atom type, Atom **args, unsigned long *nitems) | 178 int x11_get_property(Atom type, Atom **args, unsigned long *nitems) |
161 { | 179 { |
162 int format; | 180 int format; |
168 } | 186 } |
169 | 187 |
170 int vo_wm_detect( void ) | 188 int vo_wm_detect( void ) |
171 { | 189 { |
172 int i; | 190 int i; |
173 int wm = vo_wm_Unknown; | 191 int wm = 0; |
174 unsigned long nitems; | 192 unsigned long nitems; |
175 Atom * args = NULL; | 193 Atom * args = NULL; |
176 | 194 |
177 if ( WinID >= 0 ) return vo_wm_Unknown; | 195 if ( WinID >= 0 ) return 0; |
178 | 196 |
179 // -- supports layers | 197 // -- supports layers |
180 if (x11_get_property(XA_WIN_PROTOCOLS, &args, &nitems)) | 198 if (x11_get_property(XA_WIN_PROTOCOLS, &args, &nitems)) |
181 { | 199 { |
182 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm supports layers.\n" ); | 200 mp_msg( MSGT_VO,MSGL_V,"[x11] Detected wm supports layers.\n" ); |
183 for (i = 0; i < nitems; i++) | 201 for (i = 0; i < nitems; i++) |
184 { | 202 { |
185 if ( args[i] == XA_WIN_LAYER) { | 203 if ( args[i] == XA_WIN_LAYER) { |
186 wm = vo_wm_Layered; | 204 wm |= vo_wm_LAYER; |
187 metacity_hack |= 1; | 205 metacity_hack |= 1; |
188 } | 206 } else |
189 if ( args[i] == XA_WIN_HINTS) | 207 if ( args[i] == XA_WIN_HINTS) |
190 // metacity is the only manager which supports _WIN_LAYER but not _WIN_HINTS | 208 // metacity is the only manager which reports that supports _WIN_LAYER but not _WIN_HINTS. |
191 // what's more is has broken _WIN_LAYER support | 209 // what's more is has broken _WIN_LAYER support |
192 metacity_hack |= 2; | 210 metacity_hack |= 2; |
193 } | 211 } |
194 XFree( args ); | 212 XFree( args ); |
195 if (wm && metacity_hack == 3) | 213 if (wm && (metacity_hack == 1)) |
196 return wm; | 214 { |
215 // metacity reports that it supports layers, but it is not really truth :-) | |
216 wm ^= vo_wm_LAYER; | |
217 mp_msg( MSGT_VO,MSGL_V,"[x11] Using workaround for Metacity bugs.\n" ); | |
218 } | |
197 } | 219 } |
198 | 220 |
199 if (metacity_hack == 1) | |
200 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Using workaround for Metacity bugs.\n" ); | |
201 | |
202 // --- netwm | 221 // --- netwm |
203 if (x11_get_property(XA_NET_SUPPORTED, &args, &nitems)) | 222 if (x11_get_property(XA_NET_SUPPORTED, &args, &nitems)) |
204 { | 223 { |
205 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is of class NetWM.\n" ); | 224 mp_msg( MSGT_VO,MSGL_V,"[x11] Detected wm supports NetWM.\n" ); |
206 net_wm_support = 0; | |
207 for (i = 0; i < nitems; i++) | 225 for (i = 0; i < nitems; i++) |
208 net_wm_support |= net_wm_support_state_test (args[i]); | 226 wm |= net_wm_support_state_test (args[i]); |
209 XFree( args ); | 227 XFree( args ); |
210 if (net_wm_support) | 228 // ugly hack for broken OpenBox _NET_WM_STATE_FULLSCREEN support |
229 // (in their implementation it only changes internal state of window, nothing more!!!) | |
230 if (wm & vo_wm_FULLSCREEN) | |
211 { | 231 { |
212 // ugly hack for broken OpenBox _NET_WM_STATE_FULLSCREEN support | 232 if (x11_get_property(XA_BLACKBOX_PID, &args, &nitems)) |
213 // (in their implementation it only changes internal state of window, nothing more!!!) | |
214 if (net_wm_support & SUPPORT_FULLSCREEN) | |
215 { | |
216 if (x11_get_property(XA_BLACKBOX_PID, &args, &nitems)) | |
217 { | 233 { |
218 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is a broken OpenBox.\n" ); | 234 mp_msg( MSGT_VO,MSGL_V,"[x11] Detected wm is a broken OpenBox.\n" ); |
219 net_wm_support=0; | 235 wm ^= vo_wm_FULLSCREEN; |
220 XFree( args ); | |
221 return vo_wm_Unknown; | |
222 } | 236 } |
223 XFree (args); | 237 XFree (args); |
224 } | |
225 return vo_wm_NetWM; | |
226 } | 238 } |
227 } | 239 } |
228 | 240 |
229 if ( wm == vo_wm_Unknown ) mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Unknown wm type...\n" ); | 241 if ( wm == 0 ) mp_msg( MSGT_VO,MSGL_V,"[x11] Unknown wm type...\n" ); |
230 return wm; | 242 return wm; |
231 } | 243 } |
232 | 244 |
233 void vo_init_atoms( void ) | 245 void vo_init_atoms( void ) |
234 { | 246 { |
235 XA_INIT(_NET_SUPPORTED); | 247 XA_INIT(_NET_SUPPORTED); |
236 XA_INIT(_NET_WM_STATE); | 248 XA_INIT(_NET_WM_STATE); |
237 XA_INIT(_NET_WM_STATE_FULLSCREEN); | 249 XA_INIT(_NET_WM_STATE_FULLSCREEN); |
238 XA_INIT(_NET_WM_STATE_ABOVE); | 250 XA_INIT(_NET_WM_STATE_ABOVE); |
239 XA_INIT(_NET_WM_STATE_STAYS_ON_TOP); | 251 XA_INIT(_NET_WM_STATE_STAYS_ON_TOP); |
252 XA_INIT(_NET_WM_STATE_BELOW); | |
240 XA_INIT(_NET_WM_PID); | 253 XA_INIT(_NET_WM_PID); |
241 XA_INIT(_WIN_PROTOCOLS); | 254 XA_INIT(_WIN_PROTOCOLS); |
242 XA_INIT(_WIN_LAYER); | 255 XA_INIT(_WIN_LAYER); |
243 XA_INIT(_WIN_HINTS); | 256 XA_INIT(_WIN_HINTS); |
244 XA_INIT(_BLACKBOX_PID); | 257 XA_INIT(_BLACKBOX_PID); |
364 vo_screenwidth,vo_screenheight, | 377 vo_screenwidth,vo_screenheight, |
365 depth, vo_depthonscreen, | 378 depth, vo_depthonscreen, |
366 dispName,mLocalDisplay?"local":"remote"); | 379 dispName,mLocalDisplay?"local":"remote"); |
367 | 380 |
368 vo_wm_type=vo_wm_detect(); | 381 vo_wm_type=vo_wm_detect(); |
382 | |
383 vo_fs_type=vo_x11_get_fs_type(vo_wm_type); | |
369 | 384 |
370 saver_off(mDisplay); | 385 saver_off(mDisplay); |
371 return 1; | 386 return 1; |
372 } | 387 } |
373 | 388 |
657 mplayer_put_key(MOUSE_BTN0+Event.xbutton.button-1); | 672 mplayer_put_key(MOUSE_BTN0+Event.xbutton.button-1); |
658 break; | 673 break; |
659 case PropertyNotify: | 674 case PropertyNotify: |
660 { | 675 { |
661 char * name = XGetAtomName( mydisplay,Event.xproperty.atom ); | 676 char * name = XGetAtomName( mydisplay,Event.xproperty.atom ); |
662 int wm = vo_wm_Unknown; | |
663 | 677 |
664 if ( !name ) break; | 678 if ( !name ) break; |
665 | 679 |
666 // fprintf(stderr,"[ws] PropertyNotify ( 0x%x ) %s ( 0x%x )\n",vo_window,name,Event.xproperty.atom ); | 680 // fprintf(stderr,"[ws] PropertyNotify ( 0x%x ) %s ( 0x%x )\n",vo_window,name,Event.xproperty.atom ); |
667 | 681 |
706 if (XGetWindowProperty (mDisplay, win, XA_WIN_LAYER, 0, 16384, | 720 if (XGetWindowProperty (mDisplay, win, XA_WIN_LAYER, 0, 16384, |
707 False, AnyPropertyType, &type, &format, &nitems, | 721 False, AnyPropertyType, &type, &format, &nitems, |
708 &bytesafter, (unsigned char **) &args) == Success | 722 &bytesafter, (unsigned char **) &args) == Success |
709 && nitems > 0 && args) | 723 && nitems > 0 && args) |
710 { | 724 { |
711 mp_msg (MSGT_VO, MSGL_STATUS, "[x11] original window layer is %d.\n", *args); | 725 mp_msg (MSGT_VO, MSGL_V, "[x11] original window layer is %d.\n", *args); |
712 return *args; | 726 return *args; |
713 } | 727 } |
714 return WIN_LAYER_NORMAL; | 728 return WIN_LAYER_NORMAL; |
715 } | 729 } |
716 | 730 |
717 void vo_x11_setlayer( Display * mDisplay,Window vo_window,int layer ) | 731 void vo_x11_setlayer( Display * mDisplay,Window vo_window,int layer ) |
718 { | 732 { |
719 if ( WinID >= 0 ) return; | 733 if (WinID >= 0) return; |
720 | 734 |
721 // window manager could be changed during play | 735 if ( vo_fs_type & vo_wm_LAYER ) |
722 vo_wm_type=vo_wm_detect(); | |
723 | |
724 switch ( vo_wm_type ) | |
725 { case vo_wm_Layered: | |
726 { | 736 { |
727 XClientMessageEvent xev; | 737 XClientMessageEvent xev; |
728 | 738 |
729 if (layer) orig_layer=vo_x11_get_gnome_layer( mDisplay, vo_window ); | 739 if (layer) orig_layer=vo_x11_get_gnome_layer( mDisplay, vo_window ); |
730 | 740 |
732 xev.type = ClientMessage; | 742 xev.type = ClientMessage; |
733 xev.display= mDisplay; | 743 xev.display= mDisplay; |
734 xev.window = vo_window; | 744 xev.window = vo_window; |
735 xev.message_type = XA_WIN_LAYER; | 745 xev.message_type = XA_WIN_LAYER; |
736 xev.format = 32; | 746 xev.format = 32; |
737 xev.data.l[0] = layer?ice_layer:orig_layer; // if not fullscreen, stay on default layer | 747 xev.data.l[0] = layer?fs_layer:orig_layer; // if not fullscreen, stay on default layer |
738 xev.data.l[1] = CurrentTime; | 748 xev.data.l[1] = CurrentTime; |
739 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Layered style stay on top ( layer %d ).\n",xev.data.l[0] ); | 749 mp_msg( MSGT_VO,MSGL_V,"[x11] Layered style stay on top ( layer %d ).\n",xev.data.l[0] ); |
740 printf( "[x11] Layered style stay on top ( layer %d ).\n",(int)xev.data.l[0] ); | |
741 XSendEvent(mDisplay, mRootWin, False, SubstructureNotifyMask, (XEvent *) &xev); | 750 XSendEvent(mDisplay, mRootWin, False, SubstructureNotifyMask, (XEvent *) &xev); |
742 break; | 751 } else |
743 } | 752 if ( vo_fs_type & vo_wm_NETWM ) |
744 case vo_wm_NetWM: | 753 { |
745 { | |
746 XClientMessageEvent xev; | 754 XClientMessageEvent xev; |
747 char *state; | 755 char *state; |
748 | 756 |
749 memset( &xev,0,sizeof( xev ) ); | 757 memset( &xev,0,sizeof( xev ) ); |
750 xev.type=ClientMessage; | 758 xev.type=ClientMessage; |
752 xev.display=mDisplay; | 760 xev.display=mDisplay; |
753 xev.window=vo_window; | 761 xev.window=vo_window; |
754 xev.format=32; | 762 xev.format=32; |
755 xev.data.l[0]=layer; | 763 xev.data.l[0]=layer; |
756 | 764 |
757 if (net_wm_support & SUPPORT_ABOVE) | 765 if ( vo_fs_type & vo_wm_STAYS_ON_TOP ) |
758 { | 766 xev.data.l[1]=XA_NET_WM_STATE_STAYS_ON_TOP; |
767 else | |
768 if ( vo_fs_type & vo_wm_ABOVE ) | |
759 xev.data.l[1]=XA_NET_WM_STATE_ABOVE; | 769 xev.data.l[1]=XA_NET_WM_STATE_ABOVE; |
760 XSendEvent( mDisplay,mRootWin,False,SubstructureRedirectMask,(XEvent*)&xev ); | 770 else |
761 } else | 771 if ( vo_fs_type & vo_wm_FULLSCREEN ) |
762 if (net_wm_support & SUPPORT_STAYS_ON_TOP) | |
763 { | |
764 xev.data.l[1]=XA_NET_WM_STATE_STAYS_ON_TOP; | |
765 XSendEvent( mDisplay,mRootWin,False,SubstructureRedirectMask,(XEvent*)&xev ); | |
766 } else | |
767 if (net_wm_support & SUPPORT_FULLSCREEN) | |
768 { | |
769 xev.data.l[1]=XA_NET_WM_STATE_FULLSCREEN; | 772 xev.data.l[1]=XA_NET_WM_STATE_FULLSCREEN; |
770 XSendEvent( mDisplay,mRootWin,False,SubstructureRedirectMask,(XEvent*)&xev ); | 773 else |
771 } | 774 if ( vo_fs_type & vo_wm_BELOW ) |
775 // This is not fallback. We can safely assume that situation where | |
776 // only NETWM_STATE_BELOW is supported and others not, doesn't exist. | |
777 xev.data.l[1]=XA_NET_WM_STATE_BELOW; | |
778 | |
779 XSendEvent( mDisplay,mRootWin,False,SubstructureRedirectMask,(XEvent*)&xev ); | |
772 state = XGetAtomName (mDisplay, xev.data.l[1]); | 780 state = XGetAtomName (mDisplay, xev.data.l[1]); |
773 mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] NET style stay on top ( layer %d ). Using state %s.\n",layer,state ); | 781 mp_msg( MSGT_VO,MSGL_V,"[x11] NET style stay on top ( layer %d ). Using state %s.\n",layer,state ); |
774 printf( "[x11] NET style stay on top ( layer %d ). Using state %s.\n",layer,state ); | |
775 XFree (state); | 782 XFree (state); |
783 } | |
784 } | |
785 | |
786 int vo_x11_get_fs_type( int supported ) | |
787 { | |
788 int i; | |
789 int type; | |
790 | |
791 if (vo_fstype_list) { | |
792 i = 0; | |
793 for (i = 0; vo_fstype_list[i]; i++) | |
794 { | |
795 type = supported; | |
796 | |
797 if (strncmp(vo_fstype_list[i], "layer", 5) == 0) | |
798 { | |
799 if (vo_fstype_list[i][5] == '=') | |
800 { | |
801 char *endptr = NULL; | |
802 int layer = strtol(vo_fstype_list[i]+6, &endptr, 10); | |
803 | |
804 if (endptr && *endptr == '\0' && layer >= 0 && layer <= 15) | |
805 fs_layer = layer; | |
806 } | |
807 type &= vo_wm_LAYER; | |
808 } | |
809 else if (strcmp(vo_fstype_list[i], "above") == 0) type &= vo_wm_ABOVE; | |
810 else if (strcmp(vo_fstype_list[i], "fullscreen") == 0) type &= vo_wm_FULLSCREEN; | |
811 else if (strcmp(vo_fstype_list[i], "stays_on_top") == 0) type &= vo_wm_STAYS_ON_TOP; | |
812 else if (strcmp(vo_fstype_list[i], "below") == 0) type &= vo_wm_BELOW; | |
813 else if (strcmp(vo_fstype_list[i], "none") == 0) return 0; | |
814 else type = 0; | |
815 | |
816 if (type) | |
817 return type; | |
818 } | |
776 } | 819 } |
777 } | 820 |
778 } | 821 return supported; |
779 | 822 } |
823 | |
780 void vo_x11_fullscreen( void ) | 824 void vo_x11_fullscreen( void ) |
781 { | 825 { |
782 int x,y,w,h; | 826 int x,y,w,h; |
783 | 827 |
784 if ( WinID >= 0 ) return; | 828 if ( WinID >= 0 ) return; |
785 | 829 |
786 // window manager could be changed during play | |
787 vo_wm_type=vo_wm_detect(); | |
788 | |
789 if ( vo_fs ){ | 830 if ( vo_fs ){ |
790 // fs->win | 831 // fs->win |
791 if(vo_dwidth != vo_screenwidth && vo_dheight != vo_screenheight) return; | 832 if(vo_dwidth != vo_screenwidth && vo_dheight != vo_screenheight) return; |
792 vo_fs=VO_FALSE; | 833 vo_fs=VO_FALSE; |
793 x=vo_old_x; y=vo_old_y; w=vo_old_width; h=vo_old_height; | 834 x=vo_old_x; y=vo_old_y; w=vo_old_width; h=vo_old_height; |
798 (vo_dheight==vo_screenheight && vo_dheight!=vo_old_height) ) return; | 839 (vo_dheight==vo_screenheight && vo_dheight!=vo_old_height) ) return; |
799 vo_fs=VO_TRUE; | 840 vo_fs=VO_TRUE; |
800 vo_old_x=vo_dx; vo_old_y=vo_dy; vo_old_width=vo_dwidth; vo_old_height=vo_dheight; | 841 vo_old_x=vo_dx; vo_old_y=vo_dy; vo_old_width=vo_dwidth; vo_old_height=vo_dheight; |
801 x=0; y=0; w=vo_screenwidth; h=vo_screenheight; | 842 x=0; y=0; w=vo_screenwidth; h=vo_screenheight; |
802 } | 843 } |
803 if (net_wm_support!=SUPPORT_FULLSCREEN || metacity_hack==1) | 844 vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 0 : 1 ); |
804 { | 845 vo_x11_sizehint( x,y,w,h,0 ); |
805 vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 0 : 1 ); | |
806 vo_x11_sizehint( x,y,w,h,0 ); | |
807 } | |
808 vo_x11_setlayer( mDisplay,vo_window,vo_fs ); | 846 vo_x11_setlayer( mDisplay,vo_window,vo_fs ); |
809 if (net_wm_support!=SUPPORT_FULLSCREEN || metacity_hack==1) | 847 if(vo_wm_type==0 && !(vo_fsmode&16)) |
810 { | 848 // XUnmapWindow( mDisplay,vo_window ); // required for MWM |
811 if(vo_wm_type==vo_wm_Unknown && !(vo_fsmode&16)) | |
812 // XUnmapWindow( mDisplay,vo_window ); // required for MWM | |
813 XWithdrawWindow(mDisplay,vo_window,mScreen); | 849 XWithdrawWindow(mDisplay,vo_window,mScreen); |
814 XMoveResizeWindow( mDisplay,vo_window,x,y,w,h ); | 850 XMoveResizeWindow( mDisplay,vo_window,x,y,w,h ); |
815 } | |
816 #ifdef HAVE_XINERAMA | 851 #ifdef HAVE_XINERAMA |
817 vo_x11_xinerama_move(mDisplay,vo_window); | 852 vo_x11_xinerama_move(mDisplay,vo_window); |
818 #endif | 853 #endif |
819 XMapRaised( mDisplay,vo_window ); | 854 XMapRaised( mDisplay,vo_window ); |
820 XRaiseWindow( mDisplay,vo_window ); | 855 XRaiseWindow( mDisplay,vo_window ); |