Repository navigation
fix(desktop): prevent macOS fullscreen ghost windows - #12126
Conversation
|
Intent: Prevent macOS native-fullscreen transitions from leaving an immovable AppKit snapshot over the desktop, while keeping every explicit restore path usable after an application-level tray hide. |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify on hardware that a fullscreen main-window close with a secondary connection window open hides both and one Dock/tray click restores them. [DESIGN-REVIEWED] df5eab6 |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify on a multi-window session that a fullscreen main-window tray-close hiding every open connection window is acceptable — the description never states that consequence. Not justified as shipped
What this change shipsInventory (10 items) — 9 justifiedIntent: FIX — stop macOS tray-closes around fullscreen transitions from leaving an immovable AppKit snapshot overlay (Fixes #10159, with measured reproductions).
Rewritten test pins (backstop [FIRST-PRINCIPLES-REVIEWED] df5eab6 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
3de929b to
3fc2ce3
Compare
|
span=4224e4e09b96
|
3fc2ce3 to
c2ba31f
Compare
|
span=538694776b8b
|
|
All code-related checks are green on
The PR author token has read permission on the upstream repository, so GitHub refuses both reruns with “Must have admin rights to Repository.” |
c2ba31f to
bf73340
Compare
bf73340 to
b0e8c8b
Compare
|
Pushed
|
b0e8c8b to
6e1b1f1
Compare
6e1b1f1 to
6c397ff
Compare
Wait for native fullscreen motion to settle before exiting and hide the application so abandoned AppKit snapshots cannot remain onscreen. Add bounded recovery for stalled transitions and keep every user-driven restore path consistent with application-level hiding.
6c397ff to
df5eab6
Compare
UX Review (Fable 5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Verify on a Mac that a fullscreen tray-close's app-level hide doesn't strand a second connection window the user never closed — one Dock click must restore it. [UX-REVIEWED] df5eab6 |
|
Reviewed at Withholding approval on one verified gap
if (win.isMinimized()) win.restore();
win.show();
win.focus();
...
if (!ready) return false;
if (slotKey) wc.send("navigate", `/chat?sid=…`);
return true; // <- overlay dismisses the sticky approval on trueReached from the pet overlay via This is the exact failure class the PR fixes one file over, with the reasoning already written down at
Wider, same cause: I could not verify on a real macOS whether
What I verified as soundMutation falsification — 10/10 caught, 0 survived. Every guard is load-bearing and pinned. Baseline 105 pass / 0 fail confirmed before and after each mutation, files restored byte-identical, tree clean.
State machine. No path where the close gesture visibly does nothing: every deferred path is terminated by No unreachable-hidden state.
Non-macOS is genuinely untouched. Two nits, neither worth a revision on its own
Happy to approve as soon as the |
|
Thanks for flagging this. I tested the actual user paths on Electron 43 and macOS 26. In the merged #12126 build:
I now have a local follow-up implementation with this behavior:
The real fullscreen-close path passed 10/10 rounds. Across 8,428 window samples at approximately 157 Hz, neither the Dashboard nor a ghost window appeared. Repeated manual |
Wait for native fullscreen motion to settle before exiting and hide the application so abandoned AppKit snapshots cannot remain onscreen. Add bounded recovery for stalled transitions and keep every user-driven restore path consistent with application-level hiding. Co-authored-by: Rui Tao <ruit@amazon.com>
Problem / Motivation
On macOS, closing Kiro Crew around a native fullscreen transition can leave an immovable full-display copy of the window over the desktop. The copy has no traffic lights, cannot be resized or moved, and can remain after the real application window has hidden.
Why it matters
The abandoned window snapshot covers other applications and leaves no usable Kiro Crew window to dismiss. Clamshell and multi-display setups can encounter the failure during ordinary fullscreen, display, sleep, and tray-close transitions.
What changed (motivation → approach → change)
AppKit can report a fullscreen transition as complete before its Space animation is actually quiet. Issuing the reverse transition during that interval abandons AppKit's snapshot overlay, while hiding only the real window leaves the overlay onscreen.
The macOS tray-close path waits for a bounded quiet period before leaving fullscreen, hides the application so any AppKit-owned overlay is ordered out, and reasserts that hide after the transition tail. If an exit is already in flight, the close attaches to its terminal event instead of issuing a second fullscreen toggle; the same protection remains active through AppKit's short post-terminal order-in tail. A bounded watchdog detects stalled or reversed fullscreen transitions and performs the application-level repair without re-showing a window the user dismissed.
The
website/electrondesktop shell keeps close intent live across independent timeout paths, and every explicit reveal path restores the application before its window: Dock activation, tray actions, the global summon shortcut, settings and connection actions, and gateway errors requiring user input. A needs-user reveal cancels both its target window and any distinct main-window app-hide owner beforeapp.show(), so a pending reassert cannot hide a connection-window dialog again. Windowed closes and non-macOS behavior remain window-level. The Electron package manifest includes the new watchdog module; no dependency or lockfile changed. Desktop documentation records the transition and recovery contract.Backwards compatibility
Compatible: existing windowed-close behavior, fullscreen preferences, gateway sessions, and Windows/Linux behavior are unchanged. The macOS change only delays a fullscreen tray-close while AppKit motion settles and makes hidden-application restores explicit.
Tests
mainbase). New coverage exercises quiet-time gating, an already-active user exit, the post-terminal order-in tail, terminal-event loss, reversed transitions, listener and timer failures, duplicate closes, durable close intent, cross-window reassert cancellation, application-level repair, and every restore entry point.The restricted local host cannot produce a meaningful verdict for the profile's cross-surface backend run: 42,011 tests passed while 89 host/sandbox-dependent tests failed on unavailable systemd, process, sensitive-path, and installer facilities. The PR's standard CI runners remain authoritative for that matrix.
Manual verification
A patched universal build using Electron 43.2.0 was exercised on the affected macOS multi-display machine. Thirty real
window.close()cycles landed at randomized points 100–849 ms into fullscreen entry; all 30 hid correctly and left zero snapshot overlays. A second 30-cycle run first initiated fullscreen exit and then closed at randomized points 0–850 ms later, covering the active exit and post-terminal tail; all 30 hid correctly and left zero overlays. The unguarded enter-transition implementation previously left overlays in 7 of 20 cycles and completed only 10 of 20 hides.The application was then restored successfully through macOS app activation, the tray Show Kiro Crew action, the tray New Connection Window… action, and the global summon shortcut. The packaged asar hash matched the tested source bundle, and the universal shell contained both arm64 and x86_64 slices.
Screenshots / video
Why no screenshot: Healthy rendered pixels and controls are unchanged. The fix changes native AppKit transition ordering and is verified by the absence of an abandoned system snapshot under repeated close cycles.
Related Issues
Fixes #10159
Pattern harvest
Rule candidate: review-prompt
Pattern: A macOS fullscreen completion event may precede the end of AppKit's Space animation; code that reverses the transition must use an independent quiet-state guard and preserve application-level show/hide symmetry.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)