diff --git a/WINGs/wview_wl.c b/WINGs/wview_wl.c index 939c44a..51614d4 100644 --- a/WINGs/wview_wl.c +++ b/WINGs/wview_wl.c @@ -267,8 +267,23 @@ static void wl_map(void *vctx, W_View *view) { (void)vctx; view->flags.mapped = 1; - if (view->flags.realized && view->flags.topLevel) { + if (!view->flags.realized) + return; + if (view->flags.topLevel) { wl_redisplay(vctx, view); + return; + } + /* Non-toplevel: find the toplevel and redisplay from there, + * but only if all ancestors are realized (not mid-realization). */ + W_View *top = view->parent; + while (top && !top->flags.topLevel) { + if (!top->flags.realized) + return; + top = top->parent; + } + if (top && top->flags.realized && top->flags.mapped + && wl_redisplay_depth == 0) { + wl_redisplay(vctx, top); } }