Fix dialog visibility: trigger paint on map, enable scene node on commit

- wl_map: set mapped=1 before calling wl_redisplay (was bailing because
  mapped flag wasn't set yet)
- wl_view_commit_backing_impl: enable scene node when content is committed
  (frame_buf was created disabled, never enabled before frame was mapped)
This commit is contained in:
Levi Neely 2026-05-13 19:51:22 +02:00
parent 6d9450ea8b
commit 4870c72c78
2 changed files with 16 additions and 2 deletions

View File

@ -125,6 +125,17 @@ static void wl_noop(void *vctx, W_View *view)
(void)view;
}
static void wl_redisplay(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;
if (view->flags.realized)
wl_redisplay(vctx, view);
}
static void wl_noop_subviews(void *vctx, W_View *view)
{
(void)vctx;
@ -223,7 +234,7 @@ const W_ViewBackend W_ViewBackendWL = {
.screen_fini = wl_screen_fini,
.create_root = wl_create_root,
.realize = wl_realize,
.map = wl_noop,
.map = wl_map,
.unmap = wl_noop,
.map_subviews = wl_noop_subviews,
.unmap_subviews = wl_noop_subviews,

View File

@ -5816,8 +5816,11 @@ wl_client_reparent(WNativeWindow client, WNativeWindow new_parent, int x, int y)
void wl_view_commit_backing_impl(unsigned long id)
{
struct wl_frame_buf *fb = frame_buf_find((WNativeWindow)id);
if (fb && fb->scene_buf)
if (fb && fb->scene_buf) {
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
/* Enable the node — it has content now */
wlr_scene_node_set_enabled(&fb->scene_buf->node, true);
}
}
static void