From 110a555cfa54f686c963f2ed41dbf9d94718394d Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Wed, 13 May 2026 16:31:34 +0200 Subject: [PATCH] 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. --- src/backend/wayland/wl_backend.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 0935393..03c1997 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -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;