From f1ded24294c5f57a9895e9f3461e0b4e00c2dd95 Mon Sep 17 00:00:00 2001 From: Window Maker Date: Mon, 25 May 2026 12:49:00 +0200 Subject: [PATCH] WPrefs/wayland: fix icon preview one-click-behind with extra dispatch WINGs button callbacks trigger wl_redisplay which commits the client surface, but the compositor only processes that commit on the next wl_event_loop_dispatch. Add a zero-timeout dispatch after handling WINGs events so client commits are processed immediately, making the next scheduled frame render the updated content. Also revert posF redisplay back to posVF (posF caused gray flash). --- WPrefs.app/Icons.c | 3 +-- src/backend/wayland/wl_backend.c | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/WPrefs.app/Icons.c b/WPrefs.app/Icons.c index 702e4bb..d65a7a5 100644 --- a/WPrefs.app/Icons.c +++ b/WPrefs.app/Icons.c @@ -142,8 +142,7 @@ static void showIconLayout(WMWidget * widget, void *data) break; } - /* Force full redisplay of the entire icon position panel */ - WMRedisplayWidget(panel->posF); + WMRedisplayWidget(panel->posVF); } static void minipreview_slider_changed(WMWidget *w, void *data) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index b23adef..e3ff601 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -3702,10 +3702,17 @@ wl_event_loop_run(void) void *ectx = wmscr->eventBackendCtx; WMEvent wev; int limit = 64; + int handled = 0; while (be->pending(ectx) && limit-- > 0) { be->fetch(ectx, &wev); WMHandleEvent(&wev); + handled++; } + /* If WINGs events were processed (which may trigger client + * surface commits via wl_redisplay), do another short dispatch + * to process those commits so the next frame renders them. */ + if (handled) + wl_event_loop_dispatch(loop, 0); } } }