]> git.pld-linux.org Git - packages/mpv.git/blob - mpv-xmonad_fullscreen.patch
3c2154e7fc7c72b09a89d4d6af3a7f4ee9daff50
[packages/mpv.git] / mpv-xmonad_fullscreen.patch
1 From 54fd93856a3b34c92d0dd9e8cc972b57a92d1a5e Mon Sep 17 00:00:00 2001
2 From: wm4 <wm4@nowhere>
3 Date: Sat, 4 Oct 2014 15:03:02 +0200
4 Subject: [PATCH] x11: stupid workaround for XMonad
5
6 --x11-netwm=yes now forces NetWM fullscreen, while --x11-netwm=auto
7 (detect whether NetWM fullsctreen support is available) is the old
8 behavior and still the default.
9
10 See #888.
11 ---
12  DOCS/man/options.rst   | 18 ++++++++++++++----
13  options/options.c      |  4 ++--
14  video/out/x11_common.c |  6 +++++-
15  3 files changed, 21 insertions(+), 7 deletions(-)
16
17 diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
18 index b187259..69525ae 100644
19 --- a/DOCS/man/options.rst
20 +++ b/DOCS/man/options.rst
21 @@ -1708,16 +1708,26 @@ Window
22  ``--x11-name``
23      Set the window class name for X11-based video output methods.
24  
25 -``--x11-netwm=no``
26 +``--x11-netwm=<yes|no|auto>``
27      (X11 only)
28 -    Disable use of the NetWM protocol when switching to or from fullscreen.
29 +    Control the use of NetWM protocol features.
30 +
31      This may or may not help with broken window managers. This provides some
32      functionality that was implemented by the now removed ``--fstype`` option.
33      Actually, it is not known to the developers to which degree this option
34      was needed, so feedback is welcome.
35  
36 -    By default, NetWM support is autodetected, and using this option forces
37 -    autodetection to fail.
38 +    Specifically, ``yes`` will force use of NetWM fullscreen support, even if
39 +    not advertised by the WM. This can be useful for WMs that are broken on
40 +    purpose, like XMonad. (XMonad supposedly doesn't advertise fullscreen
41 +    support, because Flash uses it. Apparently, applications which want to
42 +    use fullscreen anyway are supposed to either ignore the NetWM support hints,
43 +    or provide a workaround. Shame on XMonad for deliberately breaking X
44 +    protocols (as if X isn't bad enough already).
45 +
46 +    By default, NetWM support is autodetected (``auto``).
47 +
48 +    This option might be removed in the future.
49  
50  
51  Disc Devices
52 diff --git a/options/options.c b/options/options.c
53 index bc016df..1639719 100644
54 --- a/options/options.c
55 +++ b/options/options.c
56 @@ -431,7 +431,8 @@ const m_option_t mp_opts[] = {
57  
58      OPT_INT64("wid", vo.WinID, CONF_GLOBAL),
59  #if HAVE_X11
60 -    OPT_FLAG("x11-netwm", vo.x11_netwm, 0),
61 +    OPT_CHOICE("x11-netwm", vo.x11_netwm, 0,
62 +               ({"auto", 0}, {"no", -1}, {"yes", 1})),
63  #endif
64      OPT_STRING("heartbeat-cmd", heartbeat_cmd, 0),
65      OPT_FLOAT("heartbeat-interval", heartbeat_interval, CONF_MIN, 0),
66 @@ -573,7 +574,6 @@ const struct MPOpts mp_default_opts = {
67          .keepaspect = 1,
68          .border = 1,
69          .WinID = -1,
70 -        .x11_netwm = 1,
71      },
72      .allow_win_drag = 1,
73      .wintitle = "mpv - ${media-title}",
74 diff --git a/video/out/x11_common.c b/video/out/x11_common.c
75 index 140069e..aed54f9 100644
76 --- a/video/out/x11_common.c
77 +++ b/video/out/x11_common.c
78 @@ -308,7 +308,7 @@ static int vo_wm_detect(struct vo *vo)
79                              &nitems);
80      if (args) {
81          MP_VERBOSE(x11, "Detected wm supports NetWM.\n");
82 -        if (vo->opts->x11_netwm) {
83 +        if (vo->opts->x11_netwm >= 0) {
84              for (i = 0; i < nitems; i++)
85                  wm |= net_wm_support_state_test(vo->x11, args[i]);
86          } else {
87 @@ -319,6 +319,10 @@ static int vo_wm_detect(struct vo *vo)
88  
89      if (wm == 0)
90          MP_VERBOSE(x11, "Unknown wm type...\n");
91 +    if (vo->opts->x11_netwm > 0 && !(wm & vo_wm_FULLSCREEN)) {
92 +        MP_WARN(x11, "Forcing NetWM FULLSCREEN support.\n");
93 +        wm |= vo_wm_FULLSCREEN;
94 +    }
95      return wm;
96  }
97  
This page took 0.069256 seconds and 2 git commands to generate.