From f9f65613ba77318a8667803b8e400ac9d97255c2 Mon Sep 17 00:00:00 2001 From: lkn Date: Sun, 28 Jun 2026 00:47:52 +0200 Subject: [PATCH] wayland: fix dockapp icon_window rendering Dock apps (e.g. wmclock) use override_redirect icon_windows that get reparented into dock tile frame_bufs. The reparent code only searched toplevel_list, missing OR views in or_list. The icon_window's scene node was never moved to the dock tile's scene tree, so it rendered invisibly at (0,0) in the wrong layer. - wl_client_reparent: search or_list for OR views and reparent their scene_node into the parent frame_buf's tree - wl_window_map: handle OR view enable so window_map(icon_win) works --- src/backend/wayland/wl_client.c | 17 +++++++++++++++++ src/backend/wayland/wl_window.c | 13 ++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/backend/wayland/wl_client.c b/src/backend/wayland/wl_client.c index dfaf137..a919818 100644 --- a/src/backend/wayland/wl_client.c +++ b/src/backend/wayland/wl_client.c @@ -91,6 +91,23 @@ wl_client_reparent(WNativeWindow client, WNativeWindow new_parent, int x, int y) return; } + /* Override-redirect view (e.g. dockapp icon_window) reparented into + * a frame_buf — move its scene node under the parent's tree. */ + { + struct wl_or_view *ov; + wl_list_for_each(ov, &wl_state.or_list, link) { + if (ov->xw_surface && + (WNativeWindow)ov->xw_surface->window_id == client) { + struct wl_frame_buf *parent_fb = frame_buf_find(new_parent); + if (parent_fb && parent_fb->tree && ov->scene_node) { + wlr_scene_node_reparent(&ov->scene_node->node, parent_fb->tree); + wlr_scene_node_set_position(&ov->scene_node->node, x, y); + } + return; + } + } + } + /* Reparent to root = dialog teardown: destroy the child frame_buf */ diff --git a/src/backend/wayland/wl_window.c b/src/backend/wayland/wl_window.c index cd02486..1919039 100644 --- a/src/backend/wayland/wl_window.c +++ b/src/backend/wayland/wl_window.c @@ -81,11 +81,22 @@ wl_window_map(WNativeWindow win) struct wl_toplevel_view *v = wl_find_view_by_id(win); if (v && v->scene_node) { wlr_scene_node_set_enabled(&v->scene_node->node, true); - /* XWayland dockapp mapping removed — no persistent X connection. */ return; } if (v) return; + /* Override-redirect view (e.g. dockapp icon_window) */ + { + struct wl_or_view *ov; + wl_list_for_each(ov, &wl_state.or_list, link) { + if (ov->xw_surface && + (WNativeWindow)ov->xw_surface->window_id == win) { + if (ov->scene_node) + wlr_scene_node_set_enabled(&ov->scene_node->node, true); + return; + } + } + } /* Frame buffer: enable its scene node and children. */ struct wl_frame_buf *fb = frame_buf_find(win); if (fb && fb->scene_buf) {