wl_backend: raise frame_bufs to top on map

Menus and other WM chrome (frame_bufs) must render above client
surfaces. Raise them to the top of the scene graph when mapped.
This commit is contained in:
Levi Neely 2026-05-14 19:16:15 +02:00
parent ed2f825ca0
commit a01895763b
1 changed files with 9 additions and 1 deletions

View File

@ -4839,6 +4839,9 @@ handle_pointer_button(struct wl_listener *listener, void *data)
* pointer and focus + raise it via the WM policy layer.
* This mirrors what the X11 backend does via ButtonPress on frame windows. */
if (ev->state == WLR_BUTTON_PRESSED) {
/* If pointer is over WM chrome (menu, titlebar), don't raise clients */
if (frame_buf_at(wl_state.pointer_x, wl_state.pointer_y))
goto deliver;
double sx, sy;
struct wl_toplevel_view *view = NULL;
view_surface_at(wl_state.pointer_x, wl_state.pointer_y,
@ -4864,6 +4867,7 @@ handle_pointer_button(struct wl_listener *listener, void *data)
}
/* Phase A: enqueue native WMEvent for WINGs */
deliver:;
WMScreen *wmscr = wl_get_wmscreen();
if (wmscr) {
WMEvent wev;
@ -5669,16 +5673,20 @@ wl_window_map(WNativeWindow win)
return; /* parent not visible yet */
}
wlr_scene_node_set_enabled(&fb->scene_buf->node, true);
wlr_scene_node_raise_to_top(&fb->scene_buf->node);
/* Also enable children (and grandchildren) */
struct wl_frame_buf *child;
wl_list_for_each(child, &wl_state.frame_list, link) {
if (child->parent_id == win && child->scene_buf) {
wlr_scene_node_set_enabled(&child->scene_buf->node, true);
wlr_scene_node_raise_to_top(&child->scene_buf->node);
/* Enable grandchildren */
struct wl_frame_buf *gc;
wl_list_for_each(gc, &wl_state.frame_list, link) {
if (gc->parent_id == child->id && gc->scene_buf)
if (gc->parent_id == child->id && gc->scene_buf) {
wlr_scene_node_set_enabled(&gc->scene_buf->node, true);
wlr_scene_node_raise_to_top(&gc->scene_buf->node);
}
}
}
}