# HG changeset patch # User attila # Date 1061835231 0 # Node ID 879ce4016b34cd8b4d9672e5bba9ea94a0017d99 # Parent 5eb539aa5250cbc5d1c6e2480ed7b35e943af79f Commit alex's fstype patch x11_common.c3.diff with additional manpage extension. diff -r 5eb539aa5250 -r 879ce4016b34 DOCS/en/mplayer.1 --- a/DOCS/en/mplayer.1 Mon Aug 25 15:29:55 2003 +0000 +++ b/DOCS/en/mplayer.1 Mon Aug 25 18:13:51 2003 +0000 @@ -1609,12 +1609,38 @@ .TP .B \-fstype Specify a priority list of fullscreen layer setting modes to be -used. +used. The available types are: +.DP0 +.RSs +.IPs "above" +use _NETWM_STATE_ABOVE hint if available +.IPs "below" +use _NETWM_STATE_BELOW hint if available +.IPs "fullscreen" +use _NETWM_STATE_FULLSCREEN hint if availale +.IPs "layer" +Use _WIN_LAYER hint with default layer +.IPs "layer=<0..15>" +Use _WIN_LAYER hint with layer number +.IPs "netwm" +force NETWM style +.IPs "none" +don't set fullscreen window layer +.IPs "stays_on_top" +use _NETWM_STATE_STAYS_ON_TOP hint if available +.RE +.DP 1 + +It's possible to negate the modes by prefixing them with "\-" +.br The default order is "layer,stays_on_top,above,fullscreen". It will be used as a fallback in case of specifying incorrect or unsupported modes. .br +OpenBox 1.x users have to use \-fstype \-fullscreen +to achive working fs switching. +.br If you experience problems with fullscreen window being covered by other windows try using a different order. diff -r 5eb539aa5250 -r 879ce4016b34 libvo/x11_common.c --- a/libvo/x11_common.c Mon Aug 25 15:29:55 2003 +0000 +++ b/libvo/x11_common.c Mon Aug 25 18:13:51 2003 +0000 @@ -164,10 +164,33 @@ 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 void fstype_dump(int fstype) +{ + if (fstype) + { + mp_msg(MSGT_VO, MSGL_V, "[x11] Current fstype setting honours"); + if (fstype & vo_wm_LAYER) + mp_msg(MSGT_VO, MSGL_V, " LAYER"); + if (fstype & vo_wm_FULLSCREEN) + mp_msg(MSGT_VO, MSGL_V, " FULLSCREEN"); + if (fstype & vo_wm_STAYS_ON_TOP) + mp_msg(MSGT_VO, MSGL_V, " STAYS_ON_TOP"); + if (fstype & vo_wm_ABOVE) + mp_msg(MSGT_VO, MSGL_V, " ABOVE"); + if (fstype & vo_wm_BELOW) + mp_msg(MSGT_VO, MSGL_V, " BELOW"); + mp_msg(MSGT_VO, MSGL_V, " X atoms\n"); + } + else + mp_msg(MSGT_VO, MSGL_V, "[x11] Current fstype setting doesn't honour any X atoms\n"); } static int net_wm_support_state_test(Atom atom) @@ -230,6 +253,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 +265,7 @@ } XFree (args); } +#endif } if ( wm == 0 ) mp_msg( MSGT_VO,MSGL_V,"[x11] Unknown wm type...\n" ); @@ -386,6 +411,8 @@ vo_wm_type=vo_wm_detect(); vo_fs_type=vo_x11_get_fs_type(vo_wm_type); + + fstype_dump(vo_fs_type); saver_off(mDisplay); return 1; @@ -840,17 +867,24 @@ static int vo_x11_get_fs_type(int supported) { int i; - int type; + int type = supported; if (vo_fstype_list) { i = 0; for (i = 0; vo_fstype_list[i]; i++) { - type = supported; + int neg = 0; + char * arg = vo_fstype_list[i]; + + if (vo_fstype_list[i][0] == '-') + { + neg = 1; + arg = vo_fstype_list[i] + 1; + } - 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,21 +892,46 @@ 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 type = 0; - - if (type) - return type; + 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; } } - return supported; + return type; } void vo_x11_fullscreen( void )