From 60efe4db7846a58e98b8d04d500d6bc9bb57ea03 Mon Sep 17 00:00:00 2001 From: lkn Date: Sun, 7 Jun 2026 15:00:08 +0200 Subject: [PATCH] wl_view_scene_node_set_enabled: find WINGs client toplevels via wl_proxy_get_id The function only handled wl_frame_buf entries. WINGs client popup menus have their own xdg_toplevel surface with a scene_node but no wl_frame_buf. Their WINGs view window IDs (0x20000000+) differ from compositor view IDs (0x10000000+), so wl_find_view_by_id could not find them. Fix: add wlc_top_get_surface_id() in wclient_wl.c which returns the libwayland-client proxy ID for the wl_surface. In wl_view_scene_node_set_enabled, use this ID to iterate the compositor toplevel_list and find the matching wlr_surface resource by object ID. Then enable/disable the view scene_node directly. --- WINGs/wclient_wl.c | 8 ++++++++ src/backend/wayland/wl_client.c | 21 ++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/WINGs/wclient_wl.c b/WINGs/wclient_wl.c index 260e0ac..6d877c5 100644 --- a/WINGs/wclient_wl.c +++ b/WINGs/wclient_wl.c @@ -270,6 +270,14 @@ wlc_top_find(WNativeWindow id) return NULL; } +uint32_t +wlc_top_get_surface_id(WNativeWindow id) +{ + WLClientToplevel *top = wlc_top_find(id); + if (!top || !top->surface) return 0; + return wl_proxy_get_id((struct wl_proxy *)top->surface); +} + static void wlc_top_remove(WNativeWindow id) { diff --git a/src/backend/wayland/wl_client.c b/src/backend/wayland/wl_client.c index fa9eaca..2541e64 100644 --- a/src/backend/wayland/wl_client.c +++ b/src/backend/wayland/wl_client.c @@ -316,12 +316,31 @@ void wl_view_commit_backing_impl(unsigned long id) } } } + +extern uint32_t wlc_top_get_surface_id(WNativeWindow id); + void wl_view_scene_node_set_enabled(unsigned long id, int enabled) { struct wl_frame_buf *fb = frame_buf_find((WNativeWindow)id); - if (fb && fb->scene_buf) + if (fb && fb->scene_buf) { wlr_scene_node_set_enabled(&fb->scene_buf->node, !!enabled); + return; + } + /* WINGs client toplevels (popups) have no wl_frame_buf. Match the + * client proxy ID to the compositor wlr_surface resource ID. */ + uint32_t proxy_id = wlc_top_get_surface_id((WNativeWindow)id); + if (!proxy_id) return; + struct wl_toplevel_view *v; + wl_list_for_each(v, &wl_state.toplevel_list, link) { + if (v->scene_node && v->xdg_surface + && v->xdg_surface->surface + && v->xdg_surface->surface->resource + && v->xdg_surface->surface->resource->object.id == proxy_id) { + wlr_scene_node_set_enabled(&v->scene_node->node, !!enabled); + return; + } + } }