Skip to content

⚡ Refactor WindowEngine to operate on non-main actor by default#964

Merged
SenpaiHunters merged 5 commits into
developfrom
mainactor-start-window-animations
Jan 8, 2026
Merged

⚡ Refactor WindowEngine to operate on non-main actor by default#964
SenpaiHunters merged 5 commits into
developfrom
mainactor-start-window-animations

Conversation

@mrkai77
Copy link
Copy Markdown
Owner

@mrkai77 mrkai77 commented Jan 7, 2026

  • The resize function in WindowEngine now uses a Task.detached to perform window resizing in the background, reducing UI lag that occurred when everything ran on the main actor.
  • The window resize functionality has been split into two variants: an async version that animates, and a synchronous version that resizes instantly.
  • WindowTransformAnimation now executes start() on the main actor, removing the need to manually manage a run loop on a global actor.
  • StashManager now listens to frontmost application activations, and reveals windows accordingly.

@mrkai77 mrkai77 changed the title ⚡ Refactor WindowEngine to operate off MainActor by default ⚡ Refactor WindowEngine to operate off main actor by default Jan 7, 2026
@mrkai77 mrkai77 self-assigned this Jan 7, 2026
@mrkai77 mrkai77 force-pushed the mainactor-start-window-animations branch from 0930f60 to 81e8b1d Compare January 7, 2026 23:27
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 7, 2026

🚧 Development Build Finished

@mrkai77 mrkai77 linked an issue Jan 8, 2026 that may be closed by this pull request
4 tasks
@mrkai77 mrkai77 requested a review from Copilot January 8, 2026 02:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the window resizing system to improve UI responsiveness by moving window operations off the main actor. The key changes split window frame setting into synchronous and asynchronous variants, allowing animations to run without blocking the UI.

  • Replaced setFrame(frame, animate: bool) with separate setFrame(frame) and setFrameAnimated(frame, bounds:) calls
  • Introduced conditional logic throughout StashManager to choose between animated and non-animated variants
  • Wrapped activate() calls in Task { @MainActor in } blocks to ensure proper actor isolation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Loop/Stashing/StashManager.swift Outdated
Comment thread Loop/Stashing/StashManager.swift Outdated
Comment thread Loop/Stashing/StashManager.swift Outdated
Comment thread Loop/Stashing/StashManager.swift
Comment thread Loop/Stashing/StashManager.swift Outdated
Comment thread Loop/Stashing/StashManager.swift Outdated
@mrkai77 mrkai77 requested a review from SenpaiHunters January 8, 2026 05:25
@mrkai77 mrkai77 changed the title ⚡ Refactor WindowEngine to operate off main actor by default ⚡ Refactor WindowEngine to operate on non-main actor by default Jan 8, 2026
@SenpaiHunters SenpaiHunters merged commit 7ae7a4a into develop Jan 8, 2026
1 check passed
@SenpaiHunters SenpaiHunters deleted the mainactor-start-window-animations branch January 8, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞 Loop becomes unresponsive after extended runtime

3 participants