Pause desktop synchronization while macOS is inactive - #44
Merged
Conversation
- Normalize sleep, display, and session wake notifications - Invalidate stale Accessibility work and refresh after reactivation - Build debug or release explicitly in build_and_run.sh
|
| Filename | Overview |
|---|---|
| Sources/DefiMacOS/PlatformEventNormalization.swift | Adds normalized desktop-session state, but the startup probe cannot represent a sleeping system and may suppress the later reactivation refresh. |
| Sources/DefiMacOS/PlatformEventMonitor.swift | Observes and normalizes macOS lifecycle notifications, initializes activity from the startup probe, and resets Accessibility observers while inactive. |
| Sources/DefiDaemon/DefiDaemon.swift | Gates daemon work on session activity and performs a complete synchronization when an active transition is received. |
| Sources/DefiDaemon/DaemonDesktopSynchronization.swift | Rejects snapshot completions from inactive or superseded session generations and schedules a fresh snapshot when appropriate. |
| script/build_and_run.sh | Builds and stages release binaries by default while retaining an explicit debug mode. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[PlatformEventMonitor starts] --> B[currentDesktopSessionState]
B --> C{Combined state active?}
C -- No --> D[Emit becameInactive]
D --> E[Pause desktop work]
C -- Yes --> F[Continue desktop work]
G[Wake and session notifications] --> H[DesktopSessionEventNormalizer]
H --> I{Inactive to active transition?}
I -- Yes --> J[Force complete desktop refresh]
I -- No --> K[No refresh]
B -. systemAwake is always true .-> C
Reviews (2): Last reviewed commit: "fix(hotkeys): filter remapped shortcuts ..." | Re-trigger Greptile
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.
Summary
Testing