Defer merged icon redraws during menu tracking - #1409
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca0e327666
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @discardableResult | ||
| func applyIcon(phase: Double?) -> Bool { | ||
| guard let button = self.statusItem.button else { return false } | ||
| if self.deferMergedIconRenderDuringMenuTrackingIfNeeded() { return true } |
There was a problem hiding this comment.
Run animation-state updates when deferring merged renders
When a store/icon change arrives while the merged menu is open, this new early return makes applyIcon report a skipped render, and updateIcons() immediately returns on that value before reaching its existing updateAnimationState()/updateBlinkingState() calls. In the inspected updateIcons() path, that means a refresh completion during menu tracking no longer stops the loading display-link driver (or a refresh start no longer starts it); after the menu closes the deferred icon is applied, but the stale animation driver can keep ticking/redrawing until the 30s timeout or another icon update happens. The render work can be deferred, but the animation/blink state still needs to be updated for changes observed while tracking.
Useful? React with 👍 / 👎.
ca0e327 to
841c92d
Compare
|
Landed as b7772b2. Proof:
Caveat: this is the bounded redraw mitigation for #1399; the broader WindowServer report remains open for further evidence. |
Summary
Defer merged status-icon redraws while the merged dropdown is actively tracking, then apply one latest redraw after the dropdown closes. This reduces one source of in-tracking UI churn called out in #1399 without changing menu content, provider switching, or icon rendering semantics while the menu is closed.
Context
#1399 and the follow-up bisection around #1408 split the merged-menu freeze evidence into two drivers:
This PR targets a narrow part of the second bucket: status-item icon redraws requested while the merged menu is open. Those redraws are not user-visible until the menu closes, so the work can be coalesced safely.
Change
shouldMergeIconsandisMergedMenuOpenare both true.Validation
swift test --filter StatusItemAnimationSignatureTestspasses: 6 tests.swift testpasses: 3528 tests in 402 suites.make checkpasses: SwiftFormat clean, SwiftLint found 0 violations in 1038 files.git diff --checkpasses.841c92d1.Scope notes
This is intentionally not presented as a full fix for #1399. It complements #1408 by reducing one remaining in-tracking churn source that aligns with the WindowServer-overflow evidence.