summaryrefslogtreecommitdiffstats
path: root/video/out/x11_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r--video/out/x11_common.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index fa2f2ba38c..ec74a50f56 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -69,6 +69,7 @@
#define vo_wm_ABOVE 8
#define vo_wm_BELOW 16
#define vo_wm_STICKY 32
+#define vo_wm_SKIP_TASKBAR 64
/* EWMH state actions, see
http://freedesktop.org/Standards/wm-spec/index.html#id2768769 */
@@ -148,6 +149,7 @@ static void set_screensaver(struct vo_x11_state *x11, bool enabled);
static void vo_x11_selectinput_witherr(struct vo *vo, Display *display,
Window w, long event_mask);
static void vo_x11_setlayer(struct vo *vo, bool ontop);
+static void vo_x11_set_in_taskbar(struct vo *vo, bool in);
static void vo_x11_xembed_handle_message(struct vo *vo, XClientMessageEvent *ce);
static void vo_x11_xembed_send_message(struct vo_x11_state *x11, long m[4]);
static void vo_x11_move_resize(struct vo *vo, bool move, bool resize,
@@ -335,6 +337,7 @@ static int net_wm_support_state_test(struct vo_x11_state *x11, Atom atom)
NET_WM_STATE_TEST(STAYS_ON_TOP);
NET_WM_STATE_TEST(BELOW);
NET_WM_STATE_TEST(STICKY);
+ NET_WM_STATE_TEST(SKIP_TASKBAR);
return 0;
}
@@ -1128,7 +1131,7 @@ static void vo_x11_update_composition_hint(struct vo *vo)
case 3: hint = 2; break; // always enable
}
- XChangeProperty(x11->display, x11->window, XA(x11,_NET_WM_BYPASS_COMPOSITOR),
+ XChangeProperty(x11->display, x11->window, XA(x11, _NET_WM_BYPASS_COMPOSITOR),
XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&hint, 1);
}
@@ -1809,8 +1812,8 @@ void vo_x11_config_vo_window(struct vo *vo)
rc = (struct mp_rect){0, 0, RC_W(x11->winrc), RC_H(x11->winrc)};
}
- bool reset_size = (x11->old_dw != RC_W(rc) || x11->old_dh != RC_H(rc)) &&
- (opts->auto_window_resize || x11->geometry_change);
+ bool reset_size = ((x11->old_dw != RC_W(rc) || x11->old_dh != RC_H(rc))
+ && opts->auto_window_resize) || x11->geometry_change;
reset_size |= (x11->old_x != rc.x0 || x11->old_y != rc.y0) &&
(x11->geometry_change);
@@ -1830,6 +1833,8 @@ void vo_x11_config_vo_window(struct vo *vo)
if (opts->ontop)
vo_x11_setlayer(vo, opts->ontop);
+ if (!opts->show_in_taskbar)
+ vo_x11_set_in_taskbar(vo, opts->show_in_taskbar);
vo_x11_fullscreen(vo);
@@ -1890,6 +1895,19 @@ static void vo_x11_setlayer(struct vo *vo, bool ontop)
}
}
+static void vo_x11_set_in_taskbar(struct vo *vo, bool in)
+{
+ struct vo_x11_state *x11 = vo->x11;
+ if (x11->parent || !x11->window)
+ return;
+
+ if (x11->wm_type & (vo_wm_SKIP_TASKBAR)) {
+ char *state = "_NET_WM_STATE_SKIP_TASKBAR";
+ x11_set_ewmh_state(x11, state, !in);
+ MP_VERBOSE(x11, "NET style set skip taskbar (%d).\n", !in);
+ }
+}
+
static bool rc_overlaps(struct mp_rect rc1, struct mp_rect rc2)
{
return mp_rect_intersection(&rc1, &rc2); // changes the first argument
@@ -2074,6 +2092,8 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
vo_x11_fullscreen(vo);
if (opt == &opts->ontop)
vo_x11_setlayer(vo, opts->ontop);
+ if (opt == &opts->show_in_taskbar)
+ vo_x11_set_in_taskbar(vo, opts->show_in_taskbar);
if (opt == &opts->border || opt == &opts->title_bar)
vo_x11_decoration(vo, opts->border, opts->title_bar);
if (opt == &opts->all_workspaces)