Fix spurious menu visibility: don't map child if parent is hidden

In X11, child windows are only visible when the parent is mapped.
In Wayland, all frame_bufs are independent scene nodes. The menu
content window was being mapped at creation time (wMenuCreate),
making it visible even though the parent frame was offscreen/hidden.

Fix: wl_window_map skips enabling a child node if its parent's
scene node is not yet enabled.
This commit is contained in:
Levi Neely 2026-05-13 16:31:34 +02:00
parent 7921d2def8
commit 110a555cfa
1 changed files with 7 additions and 0 deletions

View File

@ -5338,6 +5338,13 @@ wl_window_map(WNativeWindow win)
/* Frame buffer: enable its scene node and children. */
struct wl_frame_buf *fb = frame_buf_find(win);
if (fb && fb->scene_buf) {
/* If this is a child, only enable if parent is enabled */
if (fb->parent_id) {
struct wl_frame_buf *parent = frame_buf_find(fb->parent_id);
if (parent && parent->scene_buf &&
!parent->scene_buf->node.enabled)
return; /* parent not visible yet */
}
wlr_scene_node_set_enabled(&fb->scene_buf->node, true);
/* Also enable children */
struct wl_frame_buf *child;