Repository navigation
fix: keep the macOS window responsive after it is reopened from the Dock - #38
Merged
Merged
Conversation
Hiding the window to the tray set a Dart-side visibility flag that only the tray's own show path cleared. The Dock icon and a second launch show the window natively, so the flag stayed false and the app-wide TickerMode gate muted every animation: page switches, dialogs and the theme snapshot never completed, and the window looked frozen while the proxy kept running. Remove the gate and the flag. The galaxy, the only continuous animation, already mutes itself from the engine lifecycle, which every desktop embedder derives from the native window. Other animations are finite and must never be muted. The Dock reopen also restores only the main window, deminiaturizing it when minimize-to-tray left it miniaturized, and no longer lets AppKit's default reopen run on top. A minimize event that arrives after the window is back no longer hides it again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
On macOS the window could stop reacting while the proxy kept working: clicking a tab, a button or a dialog changed nothing on screen.
Hiding the window to the tray set
WindowStateService.visible = false, and only the tray's own "Show" path set it back. Clicking the Dock icon (or launching the app again) reopens the window natively inAppDelegate.applicationShouldHandleReopen, so the flag stayedfalsefor the rest of the session.AppRenderActivitywrapped the whole navigator inTickerMode(enabled: … && shown), so every ticker in the app stayed muted. Clicks were handled, but animated changes never ran: anAnimatedSwitcherpage switch kept the old page on top, dialogs stayed transparent behind a live barrier, and the theme snapshot never faded. The window looked frozen.The same gate also froze the UI when the window was visible but had lost main-window status while the app stayed active, because it treated window blur as "hidden".
Separately, the Dock reopen ran
setIsVisible(true)+makeKeyAndOrderFronton every window of the app (status item and menu windows included) and then returnedtrue, so AppKit's default reopen ran on top. A minimize-to-tray window, which is miniaturized and ordered out, was never explicitly deminiaturized. A late minimize event could also hide the window again right after it came back.Change
AppRenderActivityandWindowStateService.visible/show()/hide()are deleted, and callers usewindowManagerdirectly. The galaxy, the only continuous animation, already mutes itself from the engine lifecycle. Every desktop embedder derives that lifecycle from the native window (hidden or minimized →hidden, unfocused →inactive), and a hidden engine draws no frames at all. The remaining animations (power-button halo, launcher scan shimmer) are finite. Navigation, dialogs and the theme snapshot are therefore never muted.falseso AppKit doesn't act on the same window again.docs/galaxy-performance.mdupdated. The window-event-driven tests for the deleted gate are removed, and lifecycle-state coverage stays.Verification
flutter analyze: no new issues.dart format: clean.flutter test: all passed.home_render_lifecycle_testnow switches pages while the app isinactiveand checks that the switch completes.AppDelegate.swifttypechecks against the 3.47.7FlutterMacOSframework.Real macOS check. Throwaway debug builds of
origin/mainand of this branch, each with its own bundle id, ran a harness inside the navigator. It hid the window through the app's real close path, sent the Dock's reopen event withopen -a, then started a 300 msAnimationController:origin/mainticker=false, animation0.00after 0.9 sticker=true, animation1.00ticker=false, animation0.00ticker=true, animation1.00While the window was hidden, both builds reported lifecycle
hidden, so idle rendering is unchanged.Not verified live: a real minimize. On the test machine
miniaturizebegan but never completed, even for a bare AppKit window, so the deminiaturize branch of the Dock reopen and the late-minimize guard are covered by review and typecheck only.🤖 Generated with Claude Code