From 85216efeeaa12222d39a5a1c9ebac0a8efaf7919 Mon Sep 17 00:00:00 2001 From: Window Maker Date: Sun, 24 May 2026 17:02:13 +0200 Subject: [PATCH] WINGs/wview_wl: redisplay toplevel when non-toplevel view is mapped Non-toplevel views mapped after the toplevel (e.g., icon buttons added during Init* calls) need to trigger a redisplay to become visible. Instead of redisplaying the view itself (which crashed during realization), find the toplevel ancestor and redisplay from there. Guards: - All ancestors must be realized (prevents crash during W_RealizeView) - Toplevel must be mapped (prevents premature redisplay) - wl_redisplay_depth==0 (prevents re-entrancy) --- WINGs/wview_wl.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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); } }