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.
This commit is contained in:
Brian Ashworth 2019-02-13 12:42:58 -05:00 committed by emersion
parent d1409e3381
commit db6206aa1c

View file

@ -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);
}