diff options
author | wm4 <wm4@nowhere> | 2014-10-04 15:03:02 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-04 15:03:02 +0200 |
commit | 54fd93856a3b34c92d0dd9e8cc972b57a92d1a5e (patch) | |
tree | 3fccf15af634e3369df219aa158f51f9cd93406b | |
parent | f679c5de1bc27ac87179b6ef3869319aeba5e3f4 (diff) | |
download | mpv-54fd93856a3b34c92d0dd9e8cc972b57a92d1a5e.tar.bz2 mpv-54fd93856a3b34c92d0dd9e8cc972b57a92d1a5e.tar.xz |
x11: stupid workaround for XMonad
--x11-netwm=yes now forces NetWM fullscreen, while --x11-netwm=auto
(detect whether NetWM fullsctreen support is available) is the old
behavior and still the default.
See #888.
-rw-r--r-- | DOCS/man/options.rst | 18 | ||||
-rw-r--r-- | options/options.c | 4 | ||||
-rw-r--r-- | video/out/x11_common.c | 6 |
3 files changed, 21 insertions, 7 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index b187259206..69525aee66 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -1708,16 +1708,26 @@ Window ``--x11-name`` Set the window class name for X11-based video output methods. -``--x11-netwm=no`` +``--x11-netwm=<yes|no|auto>`` (X11 only) - Disable use of the NetWM protocol when switching to or from fullscreen. + Control the use of NetWM protocol features. + This may or may not help with broken window managers. This provides some functionality that was implemented by the now removed ``--fstype`` option. Actually, it is not known to the developers to which degree this option was needed, so feedback is welcome. - By default, NetWM support is autodetected, and using this option forces - autodetection to fail. + Specifically, ``yes`` will force use of NetWM fullscreen support, even if + not advertised by the WM. This can be useful for WMs that are broken on + purpose, like XMonad. (XMonad supposedly doesn't advertise fullscreen + support, because Flash uses it. Apparently, applications which want to + use fullscreen anyway are supposed to either ignore the NetWM support hints, + or provide a workaround. Shame on XMonad for deliberately breaking X + protocols (as if X isn't bad enough already). + + By default, NetWM support is autodetected (``auto``). + + This option might be removed in the future. Disc Devices diff --git a/options/options.c b/options/options.c index bc016dfd14..1639719dfe 100644 --- a/options/options.c +++ b/options/options.c @@ -431,7 +431,8 @@ const m_option_t mp_opts[] = { OPT_INT64("wid", vo.WinID, CONF_GLOBAL), #if HAVE_X11 - OPT_FLAG("x11-netwm", vo.x11_netwm, 0), + OPT_CHOICE("x11-netwm", vo.x11_netwm, 0, + ({"auto", 0}, {"no", -1}, {"yes", 1})), #endif OPT_STRING("heartbeat-cmd", heartbeat_cmd, 0), OPT_FLOAT("heartbeat-interval", heartbeat_interval, CONF_MIN, 0), @@ -573,7 +574,6 @@ const struct MPOpts mp_default_opts = { .keepaspect = 1, .border = 1, .WinID = -1, - .x11_netwm = 1, }, .allow_win_drag = 1, .wintitle = "mpv - ${media-title}", diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 140069e289..aed54f9010 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -308,7 +308,7 @@ static int vo_wm_detect(struct vo *vo) &nitems); if (args) { MP_VERBOSE(x11, "Detected wm supports NetWM.\n"); - if (vo->opts->x11_netwm) { + if (vo->opts->x11_netwm >= 0) { for (i = 0; i < nitems; i++) wm |= net_wm_support_state_test(vo->x11, args[i]); } else { @@ -319,6 +319,10 @@ static int vo_wm_detect(struct vo *vo) if (wm == 0) MP_VERBOSE(x11, "Unknown wm type...\n"); + if (vo->opts->x11_netwm > 0 && !(wm & vo_wm_FULLSCREEN)) { + MP_WARN(x11, "Forcing NetWM FULLSCREEN support.\n"); + wm |= vo_wm_FULLSCREEN; + } return wm; } |