Commit 3182f42
committed
fix(profiles): prompt before applying display spacing
Clicking Apply on Displays > "Menu Bar Item Spacing" while a profile is active triggered a relaunch wave for menu bar apps, after which `DisplaySettingsManager.applyActiveDisplaySpacing` called `ProfileManager.reapplyActiveProfile()`. The reapplied profile's stored `displayConfigurations` still held the previous offset, so the just-applied spacing was silently reverted, then re-applied by a second relaunch wave once the value flipped back. Reported in #619.
The Apply and inline ↺ reset buttons now route through a single confirmation gate in `DisplaySettingsPane`. When the change targets the active menu bar display, the alert names the relaunch wave; when a profile is active, the alert lets the user pick `Update Active Profile` (saves into the active profile via `updateProfile(scope:.configurationOnly)`) or `Update All Profiles` (writes the spacing into every profile via the new `ProfileManager.updateAllProfilesItemSpacingOffset(displayUUID:offset:)` helper). The profile file(s) are written synchronously before the Combine sink dispatches `applyActiveDisplaySpacing`, so the subsequent `reapplyActiveProfile` loads the new spacing instead of the old one and the value sticks.
Cases without an active profile and a non-active display still apply immediately, preserving the prior fast path. Cancelling the alert snaps the slider back to the saved value. New strings are added to `Localizable.xcstrings` for Crowdin pickup.
`DisplaySettingsManager.loadInitialState` also now adopts externally configured system spacing on first launch. When no per-display configurations exist yet and the user has set `NSStatusItemSpacing` outside Thaw (e.g. via a `defaults write` in Terminal), the manager seeds each connected display's `itemSpacingOffset` from that on-disk value and persists the seed inline. Previously Thaw read its own default offset of 0, computed target = 16, and fired a relaunch wave on every startup that overwrote the user's manual setting. Addresses the recurring restart loops in #602 and #598.
Fixes #598, #602, #619
Signed-off-by: Amir Zarrinkafsh <3339418+nightah@users.noreply.github.com>1 parent a47970c commit 3182f42
4 files changed
Lines changed: 275 additions & 9 deletions
File tree
- Thaw
- Resources
- Settings
- Models
- SettingsPanes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43989 | 43989 | | |
43990 | 43990 | | |
43991 | 43991 | | |
| 43992 | + | |
| 43993 | + | |
| 43994 | + | |
| 43995 | + | |
| 43996 | + | |
| 43997 | + | |
| 43998 | + | |
| 43999 | + | |
| 44000 | + | |
| 44001 | + | |
| 44002 | + | |
| 44003 | + | |
| 44004 | + | |
| 44005 | + | |
| 44006 | + | |
| 44007 | + | |
| 44008 | + | |
| 44009 | + | |
| 44010 | + | |
| 44011 | + | |
| 44012 | + | |
| 44013 | + | |
| 44014 | + | |
| 44015 | + | |
43992 | 44016 | | |
43993 | 44017 | | |
43994 | 44018 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
49 | 58 | | |
50 | 59 | | |
51 | 60 | | |
| |||
84 | 93 | | |
85 | 94 | | |
86 | 95 | | |
87 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
88 | 107 | | |
89 | 108 | | |
90 | 109 | | |
| |||
94 | 113 | | |
95 | 114 | | |
96 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
97 | 119 | | |
98 | 120 | | |
99 | 121 | | |
| |||
115 | 137 | | |
116 | 138 | | |
117 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
118 | 196 | | |
119 | 197 | | |
120 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
667 | 667 | | |
668 | 668 | | |
669 | 669 | | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
670 | 687 | | |
671 | 688 | | |
672 | 689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
20 | 37 | | |
21 | 38 | | |
22 | 39 | | |
| |||
26 | 43 | | |
27 | 44 | | |
28 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
29 | 61 | | |
30 | 62 | | |
31 | 63 | | |
| |||
204 | 236 | | |
205 | 237 | | |
206 | 238 | | |
207 | | - | |
208 | | - | |
209 | | - | |
| 239 | + | |
210 | 240 | | |
211 | 241 | | |
212 | 242 | | |
213 | 243 | | |
214 | 244 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 245 | + | |
219 | 246 | | |
220 | 247 | | |
221 | 248 | | |
| |||
235 | 262 | | |
236 | 263 | | |
237 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
238 | 385 | | |
0 commit comments