wl_backend: handle IN_MOVED_TO for atomic file replacement

WMWritePropListToFile uses an atomic write pattern: write to a temp
file, fsync, fclose, then rename to the destination. The inotify
directory watch sees:
  1. IN_CLOSE_WRITE on the temp file (WindowMaker.XXXXXX)
  2. IN_MOVED_TO on WindowMaker (the rename)

We were only handling IN_CLOSE_WRITE, but at that point the rename
hadn't happened yet, so stat(WindowMaker) returned the OLD mtime
and we skipped. The NEXT save's IN_CLOSE_WRITE would then catch
the PREVIOUS save's mtime change — hence the 'one click behind'
pattern users observed.

Now handles IN_MOVED_TO too, catching the actual atomic replacement.

Also removed debug logging.
This commit is contained in:
Window Maker 2026-05-24 14:55:10 +02:00
parent e97c76b582
commit c9a0fe8654
1 changed files with 2 additions and 1 deletions

View File

@ -3281,7 +3281,8 @@ static void wl_handle_inotify_events(void)
}
wPreferences.flags.noupdates = 1;
}
if ((pevent->mask & IN_CLOSE_WRITE) && oneShotFlag == 0) {
if (((pevent->mask & IN_CLOSE_WRITE) || (pevent->mask & IN_MOVED_TO))
&& oneShotFlag == 0) {
wDefaultsCheckDomains(NULL);
oneShotFlag = 1;
}