Commit 6db1da3
authored
fix(display): skip relaunch wave on resolution-only screen-parameters changes (#569)
PR #529 (commit `1ed2ce67`, "feat: per-display menu bar spacing with dynamic apply") wired `DisplaySettingsManager.applyActiveDisplaySpacing` to `NSApplication.didChangeScreenParametersNotification` so each display's saved spacing follows the active menu bar around. That notification fires for every screen-parameter event though, including resolution changes, lid open/close, and GPU/sleep transitions on a display that is already connected. Each fire armed a preflight settling window and ran `applyOffset`, and any time the on-disk byHost values disagreed with the target (Control Center restart, sleep/wake clobber, mid-flight oscillation across profiles) the call escalated to a full relaunch wave even though the user had only changed a setting of the display, not changed to a different display.
`DisplaySettingsManager` now records the active menu bar display UUID inside `applyActiveDisplaySpacing` and the `didChangeScreenParametersNotification` sink compares the current UUID against that cache via a new `shouldSkipSpacingApply(currentActiveDisplayUUID:lastAppliedActiveDisplayUUID:)` static predicate. When the UUIDs match (the resolution/lid/GPU case) the sink logs "Active menu bar display unchanged" and returns; when they differ (laptop docked, active menu bar moved to another monitor, first event after launch) the existing apply path runs as before. The `$configurations` and external Settings-URI paths are untouched: those reflect deliberate user intent and continue to rely on the no-op guard in `MenuBarItemSpacingManager.applyOffset` to short-circuit when target equals on-disk.
Adds `ThawTests/DisplaySettingsManagerSpacingGateTests` with eight cases pinning the predicate (matching, differing, either-nil, both-nil, repeated-stable) and the field semantics on a fresh `DisplaySettingsManager` instance. The new file is picked up automatically by the `ThawTests` synchronized-folder reference so no project edits are required.
Fixes #551
Signed-off-by: Amir Zarrinkafsh <3339418+nightah@users.noreply.github.com>1 parent 81fa976 commit 6db1da3
2 files changed
Lines changed: 112 additions & 0 deletions
File tree
- ThawTests
- Thaw/Settings/Models
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| |||
162 | 168 | | |
163 | 169 | | |
164 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
165 | 179 | | |
166 | 180 | | |
167 | 181 | | |
| |||
191 | 205 | | |
192 | 206 | | |
193 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
194 | 224 | | |
195 | 225 | | |
196 | 226 | | |
| |||
200 | 230 | | |
201 | 231 | | |
202 | 232 | | |
| 233 | + | |
203 | 234 | | |
204 | 235 | | |
205 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
0 commit comments