comparison libvo/x11_common.c @ 10695:879ce4016b34

Commit alex's fstype patch x11_common.c3.diff with additional manpage extension.
author attila
date Mon, 25 Aug 2003 18:13:51 +0000
parents 382bf4771ee7
children 2ca1fc045731
comparison
equal deleted inserted replaced
10694:5eb539aa5250 10695:879ce4016b34
162 mp_msg(MSGT_VO, MSGL_INFO, MSGTR_AvailableFsType); 162 mp_msg(MSGT_VO, MSGL_INFO, MSGTR_AvailableFsType);
163 163
164 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "none", "don't set fullscreen window layer"); 164 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "none", "don't set fullscreen window layer");
165 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "layer", "use _WIN_LAYER hint with default layer"); 165 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "layer", "use _WIN_LAYER hint with default layer");
166 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "layer=<0..15>", "use _WIN_LAYER hint with a given layer number"); 166 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "layer=<0..15>", "use _WIN_LAYER hint with a given layer number");
167 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "netwm", "force NETWM style");
167 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "above", "use _NETWM_STATE_ABOVE hint if available"); 168 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "above", "use _NETWM_STATE_ABOVE hint if available");
168 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "below", "use _NETWM_STATE_BELOW hint if available"); 169 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "below", "use _NETWM_STATE_BELOW hint if available");
169 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "fullscreen", "use _NETWM_STATE_FULLSCREEN hint if availale"); 170 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "fullscreen", "use _NETWM_STATE_FULLSCREEN hint if availale");
170 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "stays_on_top", "use _NETWM_STATE_STAYS_ON_TOP hint if available"); 171 mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "stays_on_top", "use _NETWM_STATE_STAYS_ON_TOP hint if available");
172 mp_msg(MSGT_VO, MSGL_INFO, "You can also negate the settings with simply putting '-' in the beginning");
173 }
174
175 static void fstype_dump(int fstype)
176 {
177 if (fstype)
178 {
179 mp_msg(MSGT_VO, MSGL_V, "[x11] Current fstype setting honours");
180 if (fstype & vo_wm_LAYER)
181 mp_msg(MSGT_VO, MSGL_V, " LAYER");
182 if (fstype & vo_wm_FULLSCREEN)
183 mp_msg(MSGT_VO, MSGL_V, " FULLSCREEN");
184 if (fstype & vo_wm_STAYS_ON_TOP)
185 mp_msg(MSGT_VO, MSGL_V, " STAYS_ON_TOP");
186 if (fstype & vo_wm_ABOVE)
187 mp_msg(MSGT_VO, MSGL_V, " ABOVE");
188 if (fstype & vo_wm_BELOW)
189 mp_msg(MSGT_VO, MSGL_V, " BELOW");
190 mp_msg(MSGT_VO, MSGL_V, " X atoms\n");
191 }
192 else
193 mp_msg(MSGT_VO, MSGL_V, "[x11] Current fstype setting doesn't honour any X atoms\n");
171 } 194 }
172 195
173 static int net_wm_support_state_test(Atom atom) 196 static int net_wm_support_state_test(Atom atom)
174 { 197 {
175 #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; } } 198 #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; } }
228 { 251 {
229 mp_msg( MSGT_VO,MSGL_V,"[x11] Detected wm supports NetWM.\n" ); 252 mp_msg( MSGT_VO,MSGL_V,"[x11] Detected wm supports NetWM.\n" );
230 for (i = 0; i < nitems; i++) 253 for (i = 0; i < nitems; i++)
231 wm |= net_wm_support_state_test (args[i]); 254 wm |= net_wm_support_state_test (args[i]);
232 XFree( args ); 255 XFree( args );
256 #if 0
233 // ugly hack for broken OpenBox _NET_WM_STATE_FULLSCREEN support 257 // ugly hack for broken OpenBox _NET_WM_STATE_FULLSCREEN support
234 // (in their implementation it only changes internal state of window, nothing more!!!) 258 // (in their implementation it only changes internal state of window, nothing more!!!)
235 if (wm & vo_wm_FULLSCREEN) 259 if (wm & vo_wm_FULLSCREEN)
236 { 260 {
237 if (x11_get_property(XA_BLACKBOX_PID, &args, &nitems)) 261 if (x11_get_property(XA_BLACKBOX_PID, &args, &nitems))
239 mp_msg( MSGT_VO,MSGL_V,"[x11] Detected wm is a broken OpenBox.\n" ); 263 mp_msg( MSGT_VO,MSGL_V,"[x11] Detected wm is a broken OpenBox.\n" );
240 wm ^= vo_wm_FULLSCREEN; 264 wm ^= vo_wm_FULLSCREEN;
241 } 265 }
242 XFree (args); 266 XFree (args);
243 } 267 }
268 #endif
244 } 269 }
245 270
246 if ( wm == 0 ) mp_msg( MSGT_VO,MSGL_V,"[x11] Unknown wm type...\n" ); 271 if ( wm == 0 ) mp_msg( MSGT_VO,MSGL_V,"[x11] Unknown wm type...\n" );
247 return wm; 272 return wm;
248 } 273 }
384 dispName,mLocalDisplay?"local":"remote"); 409 dispName,mLocalDisplay?"local":"remote");
385 410
386 vo_wm_type=vo_wm_detect(); 411 vo_wm_type=vo_wm_detect();
387 412
388 vo_fs_type=vo_x11_get_fs_type(vo_wm_type); 413 vo_fs_type=vo_x11_get_fs_type(vo_wm_type);
414
415 fstype_dump(vo_fs_type);
389 416
390 saver_off(mDisplay); 417 saver_off(mDisplay);
391 return 1; 418 return 1;
392 } 419 }
393 420
838 } 865 }
839 866
840 static int vo_x11_get_fs_type(int supported) 867 static int vo_x11_get_fs_type(int supported)
841 { 868 {
842 int i; 869 int i;
843 int type; 870 int type = supported;
844 871
845 if (vo_fstype_list) { 872 if (vo_fstype_list) {
846 i = 0; 873 i = 0;
847 for (i = 0; vo_fstype_list[i]; i++) 874 for (i = 0; vo_fstype_list[i]; i++)
848 { 875 {
849 type = supported; 876 int neg = 0;
850 877 char * arg = vo_fstype_list[i];
851 if (strncmp(vo_fstype_list[i], "layer", 5) == 0) 878
879 if (vo_fstype_list[i][0] == '-')
852 { 880 {
853 if (vo_fstype_list[i][5] == '=') 881 neg = 1;
882 arg = vo_fstype_list[i] + 1;
883 }
884
885 if (!strncmp(arg, "layer", 5))
886 {
887 if (!neg && (arg[5] == '='))
854 { 888 {
855 char *endptr = NULL; 889 char *endptr = NULL;
856 int layer = strtol(vo_fstype_list[i]+6, &endptr, 10); 890 int layer = strtol(vo_fstype_list[i]+6, &endptr, 10);
857 891
858 if (endptr && *endptr == '\0' && layer >= 0 && layer <= 15) 892 if (endptr && *endptr == '\0' && layer >= 0 && layer <= 15)
859 fs_layer = layer; 893 fs_layer = layer;
860 } 894 }
861 type &= vo_wm_LAYER; 895 if (neg)
896 type &= ~vo_wm_LAYER;
897 else
898 type |= vo_wm_LAYER;
862 } 899 }
863 else if (strcmp(vo_fstype_list[i], "above") == 0) type &= vo_wm_ABOVE; 900 else if (!strcmp(arg, "above"))
864 else if (strcmp(vo_fstype_list[i], "fullscreen") == 0) type &= vo_wm_FULLSCREEN; 901 {
865 else if (strcmp(vo_fstype_list[i], "stays_on_top") == 0) type &= vo_wm_STAYS_ON_TOP; 902 if (neg)
866 else if (strcmp(vo_fstype_list[i], "below") == 0) type &= vo_wm_BELOW; 903 type &= ~vo_wm_ABOVE;
867 else if (strcmp(vo_fstype_list[i], "none") == 0) return 0; 904 else
868 else type = 0; 905 type |= vo_wm_ABOVE;
869 906 } else if (!strcmp(arg, "fullscreen"))
870 if (type) 907 {
871 return type; 908 if (neg)
909 type &= ~vo_wm_FULLSCREEN;
910 else
911 type |= vo_wm_FULLSCREEN;
912 } else if (!strcmp(arg, "stays_on_top"))
913 {
914 if (neg)
915 type &= ~vo_wm_STAYS_ON_TOP;
916 else
917 type |= vo_wm_STAYS_ON_TOP;
918 } else if (!strcmp(arg, "below"))
919 {
920 if (neg)
921 type &= ~vo_wm_BELOW;
922 else
923 type |= vo_wm_BELOW;
924 } else if (!strcmp(arg, "netwm"))
925 {
926 if (neg)
927 type &= ~vo_wm_NETWM;
928 else
929 type |= vo_wm_NETWM;
930 } else if (!strcmp(arg, "none")) return 0;
872 } 931 }
873 } 932 }
874 933
875 return supported; 934 return type;
876 } 935 }
877 936
878 void vo_x11_fullscreen( void ) 937 void vo_x11_fullscreen( void )
879 { 938 {
880 int x,y,w,h; 939 int x,y,w,h;