From fdf0956c023dda8c9639a62c762b7b0232bf1274 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Thu, 14 May 2026 16:52:26 +0200 Subject: [PATCH] WINGs/wview_wl: re-composite top-level after children draw The top-level was composited into root before children had painted into its backing image, resulting in a blank dialog. Now we composite the top-level a second time after wl_map_subviews so the final image includes all child content. --- WINGs/wview_wl.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/WINGs/wview_wl.c b/WINGs/wview_wl.c index 6a25f02..d47bfc2 100644 --- a/WINGs/wview_wl.c +++ b/WINGs/wview_wl.c @@ -140,12 +140,21 @@ static void wl_map_subviews(void *vctx, W_View *view); static void wl_map(void *vctx, W_View *view) { (void)vctx; - /* Set mapped early so redisplay doesn't bail out */ view->flags.mapped = 1; - /* Only trigger redisplay for top-level views (dialogs) */ if (view->flags.topLevel && view->flags.realized) { wl_redisplay(vctx, view); wl_map_subviews(vctx, view); + /* Re-composite top-level after children have drawn into it */ + if (view->parent) { + pixman_image_t *src = (pixman_image_t *)W_GetViewBacking(view->window); + pixman_image_t *dst = (pixman_image_t *)W_GetViewBacking(view->parent->window); + if (src && dst) { + pixman_image_composite32(PIXMAN_OP_OVER, src, NULL, dst, + 0, 0, 0, 0, + view->pos.x, view->pos.y, + view->size.width, view->size.height); + } + } } } @@ -156,10 +165,22 @@ static void wl_map_subviews(void *vctx, W_View *view) if (child->flags.realized) { child->flags.mapped = 1; wl_redisplay(vctx, child); + /* Recurse into grandchildren */ + if (child->childrenList) + wl_map_subviews(vctx, child); + /* Re-composite child after grandchildren have drawn into it */ + pixman_image_t *src = (pixman_image_t *)W_GetViewBacking(child->window); + pixman_image_t *dst = (pixman_image_t *)W_GetViewBacking(view->window); + if (src && dst) { + pixman_image_composite32(PIXMAN_OP_OVER, src, NULL, dst, + 0, 0, 0, 0, + child->pos.x, child->pos.y, + child->size.width, child->size.height); + } + } else { + if (child->childrenList) + wl_map_subviews(vctx, child); } - /* Recurse into grandchildren */ - if (child->childrenList) - wl_map_subviews(vctx, child); child = child->nextSister; } }