clean up diagnostics in wl_unmap and wl_view_scene_node_set_enabled

Remove duplicate W_ViewSceneNodeSetEnabledFn call, fix malformed debug code.
wl_unmap now logs cleanup diagnostics once. wl_view_scene_node_set_enabled
logs proxy ID lookup, match result, and no-match case properly.
This commit is contained in:
lkn 2026-06-07 15:38:19 +02:00
parent 7b15ded31a
commit 405c481e38
2 changed files with 10 additions and 9 deletions

View File

@ -223,9 +223,7 @@ static void wl_unmap(void *vctx, W_View *view)
W_ViewSceneNodeSetEnabledFn((unsigned long)view->window, 0);
} else
wwarning("wl_unmap: W_ViewSceneNodeSetEnabledFn is NULL");
/* Disable the scene buffer so the view disappears from screen. */
if (W_ViewSceneNodeSetEnabledFn)
W_ViewSceneNodeSetEnabledFn((unsigned long)view->window, 0);
/* Scene node disabled in the diagnostic block above. */
/* Destroy the WINGs client wl_surface + xdg_toplevel on unmap so
* the compositor has no stale state for this surface. The recycle
* function preserves the WLClientToplevel struct and ID mapping

View File

@ -327,23 +327,26 @@ wl_view_scene_node_set_enabled(unsigned long id, int enabled)
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. */
/* WINGs client toplevels: match client proxy ID to compositor
* wlr_surface resource ID for scene node enable/disable. */
uint32_t proxy_id = wlc_top_get_surface_id((WNativeWindow)id);
wwarning("set_enabled: WINGs client id=0x%lx proxy_id=%u", id, proxy_id);
if (!proxy_id) return;
if (!proxy_id) {
wwarning("set_enabled: no proxy for id=0x%lx", 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) {
t wwarning("set_enabled: matched view 0x%lx", (unsigned long)v->id);
wlr_scene_node_set_enabled(&v->scene_node->node, !!enabled);
wwarning("set_enabled: matched view 0x%lx for id=0x%lx en=%d",
(unsigned long)v->id, id, enabled);
return;
}
wwarning("set_enabled: no view matched proxy %u", proxy_id);
}
wwarning("set_enabled: NO MATCH for id=0x%lx proxy=%u", id, proxy_id);
}