diff options
author | novenary <streetwalkermc@gmail.com> | 2023-03-10 14:49:47 +0200 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2023-11-23 10:41:41 +0000 |
commit | 720e8ac26b2750a7183ef64011e195460775a60d (patch) | |
tree | 960ee034f7da7c26f98e50b6e810bb5ca8e5a7e3 | |
parent | 2eb225236eb72f27beec921e9f37ddf58e874fba (diff) |
xwm: avoid restacking managed surfaces above OR surfaces
This is consistent with other X11 window managers (checked against i3
and mutter).
-rw-r--r-- | xwayland/xwm.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 2c437e83..47679284 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1055,6 +1055,18 @@ void wlr_xwayland_surface_restack(struct wlr_xwayland_surface *xsurface, size_t idx = 0; uint32_t flags = XCB_CONFIG_WINDOW_STACK_MODE; + assert(!xsurface->override_redirect); + + // X11 clients expect their override_redirect windows to stay on top. + // Avoid interfering by restacking above the topmost managed surface. + if (mode == XCB_STACK_MODE_ABOVE && !sibling) { + sibling = wl_container_of(xwm->surfaces_in_stack_order.prev, sibling, stack_link); + } + + if (sibling == xsurface) { + return; + } + if (sibling != NULL) { values[idx++] = sibling->window_id; flags |= XCB_CONFIG_WINDOW_SIBLING; @@ -1067,11 +1079,7 @@ void wlr_xwayland_surface_restack(struct wlr_xwayland_surface *xsurface, struct wl_list *node; if (mode == XCB_STACK_MODE_ABOVE) { - if (sibling) { - node = &sibling->stack_link; - } else { - node = xwm->surfaces_in_stack_order.prev; - } + node = &sibling->stack_link; } else if (mode == XCB_STACK_MODE_BELOW) { if (sibling) { node = sibling->stack_link.prev; |