diff options
author | Kirill Primak <vyivel@eclair.cafe> | 2023-11-26 02:49:56 +0300 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2023-11-27 13:21:17 +0300 |
commit | c3c7b1c9d01ed876144fdf9210aba8d1ad38b332 (patch) | |
tree | 2074f4b6c06dd1e3e38ae418854748401f461c80 | |
parent | 4990ed99ebc8eeb508e0077f620ec2df781fabdb (diff) |
xwm: don't do anything except mapping on MapRequest
Instead, move the wlr_xwayland_surface_set_withdrawn() and
wlr_xwayland_surface_restack() calls to the MapNotify handler with an
override_redirect check, as they are done too early. This mirrors the logic in
the UnmapNotify handler and fixes a bug where wlr_xwayland_surface_restack()
would be called on an o-r window after the following sequence of requests:
- CreateWindow with override_redirect=True
- ChangeWindowAttributes with override_redirect=False
- MapWindow
Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3770
-rw-r--r-- | xwayland/xwm.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c index e744565a..88b2fe56 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1122,8 +1122,6 @@ static void xwm_handle_map_request(struct wlr_xwm *xwm, return; } - wlr_xwayland_surface_set_withdrawn(xsurface, false); - wlr_xwayland_surface_restack(xsurface, NULL, XCB_STACK_MODE_BELOW); xcb_map_window(xwm->xcb_conn, ev->window); } @@ -1135,6 +1133,11 @@ static void xwm_handle_map_notify(struct wlr_xwm *xwm, } xwm_update_override_redirect(xsurface, ev->override_redirect); + + if (!xsurface->override_redirect) { + wlr_xwayland_surface_set_withdrawn(xsurface, false); + wlr_xwayland_surface_restack(xsurface, NULL, XCB_STACK_MODE_BELOW); + } } static void xwm_handle_unmap_notify(struct wlr_xwm *xwm, |