summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-23 20:25:29 +0200
committerwm4 <wm4@nowhere>2014-05-23 20:59:36 +0200
commite2e318a213300070ca6af00951d08a44574d0cbc (patch)
tree7a49f3797229134235c4f9fe0930e705ae1cffc1
parent8033b4b4bafeb89d9803cefe87b65c544f36f0b3 (diff)
downloadmpv-e2e318a213300070ca6af00951d08a44574d0cbc.tar.bz2
mpv-e2e318a213300070ca6af00951d08a44574d0cbc.tar.xz
x11: prefer NetWM hints over _WIN_LAYER for --ontop
_WIN_LAYER is apparently an old GNOME thing (also explains why there is a function vo_x11_get_gnome_layer() involved in this code). Prefer the NetWM hints over this. This just moves the NetWM case if-body over the _WIN_LAYER one.
-rw-r--r--video/out/x11_common.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index eed1277e9e..3753a87bcf 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1352,17 +1352,7 @@ static void vo_x11_setlayer(struct vo *vo, Window vo_window, bool ontop)
if (vo->opts->WinID >= 0 || !x11->window)
return;
- if (x11->wm_type & vo_wm_LAYER) {
- if (!x11->orig_layer)
- x11->orig_layer = vo_x11_get_gnome_layer(x11, vo_window);
-
- long params[5] = {0};
- // if not fullscreen, stay on default layer
- params[0] = ontop ? WIN_LAYER_ABOVE_DOCK : x11->orig_layer;
- params[1] = CurrentTime;
- MP_VERBOSE(x11, "Layered style stay on top (layer %ld).\n", params[0]);
- x11_send_ewmh_msg(x11, "_WIN_LAYER", params);
- } else if (x11->wm_type & (vo_wm_STAYS_ON_TOP | vo_wm_ABOVE)) {
+ if (x11->wm_type & (vo_wm_STAYS_ON_TOP | vo_wm_ABOVE)) {
char *state = "_NET_WM_STATE_ABOVE";
// Not in EWMH - but the old code preferred this (maybe it is "better")
@@ -1373,6 +1363,16 @@ static void vo_x11_setlayer(struct vo *vo, Window vo_window, bool ontop)
MP_VERBOSE(x11, "NET style stay on top (%d). Using state %s.\n",
ontop, state);
+ } else if (x11->wm_type & vo_wm_LAYER) {
+ if (!x11->orig_layer)
+ x11->orig_layer = vo_x11_get_gnome_layer(x11, vo_window);
+
+ long params[5] = {0};
+ // if not fullscreen, stay on default layer
+ params[0] = ontop ? WIN_LAYER_ABOVE_DOCK : x11->orig_layer;
+ params[1] = CurrentTime;
+ MP_VERBOSE(x11, "Layered style stay on top (layer %ld).\n", params[0]);
+ x11_send_ewmh_msg(x11, "_WIN_LAYER", params);
}
}