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.
This commit is contained in:
Levi Neely 2026-05-14 16:52:26 +02:00
parent 05d819bf15
commit fdf0956c02
1 changed files with 26 additions and 5 deletions

View File

@ -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;
}
}