summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/options.rst4
-rw-r--r--options/options.c2
-rw-r--r--options/options.h1
-rw-r--r--video/out/x11_common.c6
4 files changed, 13 insertions, 0 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index c1f45f61e4..10eeb67741 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -2036,6 +2036,10 @@ Window
This option might be removed in the future.
+``--x11-bypass-compositor=<yes|no>``
+ If set to ``yes`` (default), then ask the compositor to unredirect the
+ mpv window. This uses the ``_NET_WM_BYPASS_COMPOSITOR`` hint.
+
Disc Devices
------------
diff --git a/options/options.c b/options/options.c
index fb9237938c..d344f48b1a 100644
--- a/options/options.c
+++ b/options/options.c
@@ -454,6 +454,7 @@ const m_option_t mp_opts[] = {
#if HAVE_X11
OPT_CHOICE("x11-netwm", vo.x11_netwm, 0,
({"auto", 0}, {"no", -1}, {"yes", 1})),
+ OPT_FLAG("x11-bypass-compositor", vo.x11_bypass_compositor, 0),
#endif
OPT_STRING("heartbeat-cmd", heartbeat_cmd, 0),
OPT_FLOAT("heartbeat-interval", heartbeat_interval, CONF_MIN, 0),
@@ -699,6 +700,7 @@ const struct MPOpts mp_default_opts = {
.border = 1,
.WinID = -1,
.window_scale = 1.0,
+ .x11_bypass_compositor = 1,
},
.allow_win_drag = 1,
.wintitle = "${?media-title:${media-title}}${!media-title:No file} - mpv",
diff --git a/options/options.h b/options/options.h
index 7c9046f50b..78f19f7b2f 100644
--- a/options/options.h
+++ b/options/options.h
@@ -19,6 +19,7 @@ typedef struct mp_vo_opts {
int fs_black_out_screens;
char *winname;
int x11_netwm;
+ int x11_bypass_compositor;
int native_keyrepeat;
float panscan;
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 0fd5db0ca3..95308b9559 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1385,6 +1385,12 @@ static void vo_x11_create_window(struct vo *vo, XVisualInfo *vis,
}
if (!x11->parent) {
+ if (vo->opts->x11_bypass_compositor) {
+ long v = 1; // request disabling compositor
+ XChangeProperty(x11->display, x11->window,
+ XA(x11,_NET_WM_BYPASS_COMPOSITOR), XA_CARDINAL, 32,
+ PropModeReplace, (unsigned char *)&v, 1);
+ }
vo_x11_set_wm_icon(x11);
vo_x11_update_window_title(vo);
vo_x11_dnd_init_window(vo);