Index: x11_common.c =================================================================== RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v retrieving revision 1.149 diff -u -r1.149 x11_common.c --- x11_common.c 12 Aug 2003 20:54:12 -0000 1.149 +++ x11_common.c 13 Aug 2003 19:52:15 -0000 @@ -164,10 +164,12 @@ mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "none", "don't set fullscreen window layer"); mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "layer", "use _WIN_LAYER hint with default layer"); mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "layer=<0..15>", "use _WIN_LAYER hint with a given layer number"); + mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "netwm", "force NETWM style"); mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "above", "use _NETWM_STATE_ABOVE hint if available"); mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "below", "use _NETWM_STATE_BELOW hint if available"); mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "fullscreen", "use _NETWM_STATE_FULLSCREEN hint if availale"); mp_msg(MSGT_VO, MSGL_INFO, " %-15s %s\n", "stays_on_top", "use _NETWM_STATE_STAYS_ON_TOP hint if available"); + mp_msg(MSGT_VO, MSGL_INFO, "You can also negate the settings with simply putting '-' in the beginning"); } static int net_wm_support_state_test(Atom atom) @@ -230,6 +232,7 @@ for (i = 0; i < nitems; i++) wm |= net_wm_support_state_test (args[i]); XFree( args ); +#if 0 // ugly hack for broken OpenBox _NET_WM_STATE_FULLSCREEN support // (in their implementation it only changes internal state of window, nothing more!!!) if (wm & vo_wm_FULLSCREEN) @@ -241,6 +244,7 @@ } XFree (args); } +#endif } if ( wm == 0 ) mp_msg( MSGT_VO,MSGL_V,"[x11] Unknown wm type...\n" ); @@ -846,11 +850,20 @@ i = 0; for (i = 0; vo_fstype_list[i]; i++) { + int neg = 0; + char * arg = vo_fstype_list[i]; + + if (vo_fstype_list[i][0] == '-') + { + neg = 1; + arg = vo_fstype_list[i] + 1; + } + type = supported; - if (strncmp(vo_fstype_list[i], "layer", 5) == 0) + if (!strncmp(arg, "layer", 5)) { - if (vo_fstype_list[i][5] == '=') + if (!neg && (arg[5] == '=')) { char *endptr = NULL; int layer = strtol(vo_fstype_list[i]+6, &endptr, 10); @@ -858,13 +871,42 @@ if (endptr && *endptr == '\0' && layer >= 0 && layer <= 15) fs_layer = layer; } - type &= vo_wm_LAYER; + if (neg) + type &= ~vo_wm_LAYER; + else + type |= vo_wm_LAYER; } - else if (strcmp(vo_fstype_list[i], "above") == 0) type &= vo_wm_ABOVE; - else if (strcmp(vo_fstype_list[i], "fullscreen") == 0) type &= vo_wm_FULLSCREEN; - else if (strcmp(vo_fstype_list[i], "stays_on_top") == 0) type &= vo_wm_STAYS_ON_TOP; - else if (strcmp(vo_fstype_list[i], "below") == 0) type &= vo_wm_BELOW; - else if (strcmp(vo_fstype_list[i], "none") == 0) return 0; + else if (!strcmp(arg, "above")) + { + if (neg) + type &= ~vo_wm_ABOVE; + else + type |= vo_wm_ABOVE; + } else if (!strcmp(arg, "fullscreen")) + { + if (neg) + type &= ~vo_wm_FULLSCREEN; + else + type |= vo_wm_FULLSCREEN; + } else if (!strcmp(arg, "stays_on_top")) + { + if (neg) + type &= ~vo_wm_STAYS_ON_TOP; + else + type |= vo_wm_STAYS_ON_TOP; + } else if (!strcmp(arg, "below")) + { + if (neg) + type &= ~vo_wm_BELOW; + else + type |= vo_wm_BELOW; + } else if (!strcmp(arg, "netwm")) + { + if (neg) + type &= ~vo_wm_NETWM; + else + type |= vo_wm_NETWM; + } else if (!strcmp(arg, "none")) return 0; else type = 0; if (type)