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