core/clock: update SystemClock promptly after suspend - #1153
Open
LamplighterPaul wants to merge 1 commit into
Open
LamplighterPaul wants to merge 1 commit into
LamplighterPaul wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SystemClockcomputes a wall-clock deadline but waits using a relative QTimer. On this Linux machine, that countdown pauses during suspend, leaving minute-precision clocks stale for up to another minute after wake.Use an absolute
CLOCK_REALTIMEtimerfd through QSocketNotifier on Linux. Expired deadlines update the clock when the event loop resumes;TFD_TIMER_CANCEL_ON_SETalso handles clock corrections. Consumers receive the existingdateChangedsignal. No polling, forced redraw, or suspend hook is added. Disabled clocks disarm the timer; destruction closes it. QTimer remains the fallback.Tested on Quickshell 0.3.1 / Qt 6.11.2, Omarchy 4.0.4, Linux s2idle:
Observers sampled every 250ms without changing clock data. The second test also ran the actual Omarchy bar with the patched binary: the same process survived suspend/unlock, and the user reported minute 47, matching the resume time. Exact visual-update latency was not measured.
Validation:
c6a5160.popupwindow::moveWithParentfails identically on unchanged upstream. All previously passing tests still pass.Related: #559 (closed after a binding issue), and Omarchy's polling workaround. This reproduction observes
SystemClock.dateitself and its eventual natural recovery.Developed with AI assistance and tested on the affected machine.