From db6206aa1cbc80286e3c83e8e5371f93f8f5f048 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Wed, 13 Feb 2019 12:42:58 -0500 Subject: [PATCH] xwm: stack below on map Since xwm only manipulates the stack when focusing a window, newly mapped windows should be stacked below the focused window. This prevents the newly mapped window from stealing focus due to being on the top of the stack. --- xwayland/xwm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 91fa7e3d..fc294674 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -889,6 +889,12 @@ static void xwm_handle_map_request(struct wlr_xwm *xwm, xsurface_set_wm_state(xsurface, ICCCM_NORMAL_STATE); xsurface_set_net_wm_state(xsurface); + + uint32_t values[1]; + values[0] = XCB_STACK_MODE_BELOW; + xcb_configure_window(xwm->xcb_conn, ev->window, + XCB_CONFIG_WINDOW_STACK_MODE, values); + xcb_map_window(xwm->xcb_conn, ev->window); }