fix(macos): drain native fullscreen before close behavior - #767
Open
Frank-zhu0404 wants to merge 1 commit into
Open
Frank-zhu0404 wants to merge 1 commit into
Frank-zhu0404 wants to merge 1 commit into
Conversation
Hiding or exiting the main window while it still occupies a macOS fullscreen Space (or is animating out of one) leaves a black blank plus leftover toolbar chrome. Exit fullscreen first, wait for the Space to go, then apply ask / minimize-to-tray / exit. Closes xintaofei#507
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.
On macOS, clicking the main window's close button while the workspace is in native fullscreen (or still animating out of it) intercepts
CloseRequestedand applies hide / exit / ask without leaving the fullscreen Space. That leaves a black blank plus leftover toolbar chrome instead of dismissing the window.The close path now drains native fullscreen first:
set_fullscreen(false), wait until tao's flag drops and AppKit has finished tearing down the Space (tao reportsis_fullscreen() == falseatwindowWillExitFullScreen, which is the start of the animation), then apply the configured close behavior (ask/ minimize-to-tray /exit).Linux and Windows are unchanged — fullscreen there is not a separate Space, so close does not wait.
Testing
commands/windows.rs(live fullscreen, transitioning after tao drops the flag, windowed, non-macOS never waits).cargo test --features test-utils --lib commands::windows::— 19 passed.cargo clippy --all-targets --features test-utils -- -D warningspassed.cargo check --no-default-features --lib --bin codeg-serverpassed.Closes #507