From e97c76b582ca1112b079a6a8a7a94167bd34112e Mon Sep 17 00:00:00 2001 From: Window Maker Date: Sun, 24 May 2026 14:45:45 +0200 Subject: [PATCH] wl_backend: use IN_CLOSE_WRITE instead of IN_MODIFY for inotify IN_MODIFY fires during the write, before the file is fully written. The Wayland event loop's 16ms dispatch catches this almost instantly, reading stale/partial content. IN_CLOSE_WRITE fires after the writer closes the file, guaranteeing the content is complete. This fixes the 'one step behind' issue where background changes only appeared on the second apply. --- src/backend/wayland/wl_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 0707e50..70e53b5 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -3281,7 +3281,7 @@ static void wl_handle_inotify_events(void) } wPreferences.flags.noupdates = 1; } - if ((pevent->mask & IN_MODIFY) && oneShotFlag == 0) { + if ((pevent->mask & IN_CLOSE_WRITE) && oneShotFlag == 0) { wDefaultsCheckDomains(NULL); oneShotFlag = 1; }