From 97526723670bfeefb8affec075a352c21f077369 Mon Sep 17 00:00:00 2001 From: lkn Date: Thu, 25 Jun 2026 09:49:07 +0200 Subject: [PATCH] =?UTF-8?q?wayland:=20fix=20animation=20rendering=20?= =?UTF-8?q?=E2=80=94=20dispatch=20after=20scene=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Animation loops (iconify/shade zoom) call event_flush repeatedly with wusleep delays. The scene commit returned immediately without waiting for the DRM page flip, so only the final frame was visible. After committing, flush clients and dispatch the event loop once to process the page-flip completion. This allows the next commit in the animation loop to succeed, producing smooth multi-frame animations. --- src/backend/wayland/wl_event.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/backend/wayland/wl_event.c b/src/backend/wayland/wl_event.c index ffa53ac..d7ef0c2 100644 --- a/src/backend/wayland/wl_event.c +++ b/src/backend/wayland/wl_event.c @@ -11,8 +11,16 @@ void wl_event_flush(void) { wl_xdisplay_flush(); /* Commit the scene so intermediate animation frames are visible */ - if (wl_state.scene_output && wl_state.allocator) + if (wl_state.scene_output && wl_state.allocator) { wlr_scene_output_commit(wl_state.scene_output, NULL); + /* Flush the display so the frame reaches the DRM backend, + * then dispatch to process the page-flip completion event + * before returning. Without this, animation loops that + * call event_flush repeatedly only show the final frame. */ + wl_display_flush_clients(wl_state.display); + struct wl_event_loop *loop = wl_display_get_event_loop(wl_state.display); + wl_event_loop_dispatch(loop, 0); + } } void wl_event_flush_expose(void) {} void wl_event_sync(int discard)