Stop layout switcher animation after dwell - #103
Draft
eafire15 wants to merge 1 commit into
Draft
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.
Summary
repeatForeveranimation attached to a hidden SwiftUI hosting viewNSHostingView.layoutloop reported in CPU usage #83Root cause
DockItemstarts an unbounded opacity animation while dwelling over another layout.LayoutSwitcherPanel.hide()clears the dwell state and orders the panel out, but retains itsNSHostingView. On macOS 26.6.1 the repeat animation can remain active after every MacsyZones window is offscreen.A triggered sample of v3.0.4 showed the main thread repeatedly flushing Core Animation transactions and laying out the SwiftUI hosting view, with repeat-animation frames in the hot path.
Verification
Release builds were compared with an identical temporary internal probe that presents the switcher, sets a dwell target, clears it, and hides the panel. The probe was removed from this branch after calibration.
Five paired runs, after a 10-second cooldown and discarding the first
topinterval:repeatForeverrepeatCount(2)Reduction: 95.42%.
The real v3.0.4 drag/dwell/release sequence measured 35.72% mean CPU over 20 post-hide samples, commonly 35–45%. A normal snap without switcher dwell returned to idle, isolating this animation path.
CODE_SIGNING_ALLOWED=NOScope
This intentionally does not include the separate duplicate layout-load memory fix, donation reminder behavior, updater hardening, or a broader window-lifecycle refactor.