Skip to content

fix(macos): drain native fullscreen before close behavior - #767

Open
Frank-zhu0404 wants to merge 1 commit into
xintaofei:mainfrom
Frank-zhu0404:fix/macos-fullscreen-close-507
Open

Frank-zhu0404 wants to merge 1 commit into
xintaofei:mainfrom
Frank-zhu0404:fix/macos-fullscreen-close-507

Conversation

@Frank-zhu0404

Copy link
Copy Markdown

On macOS, clicking the main window's close button while the workspace is in native fullscreen (or still animating out of it) intercepts CloseRequested and 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 reports is_fullscreen() == false at windowWillExitFullScreen, 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

  • New unit tests for the occupancy / drain decision helper in commands/windows.rs (live fullscreen, transitioning after tao drops the flag, windowed, non-macOS never waits).
  • Linux: cargo test --features test-utils --lib commands::windows:: — 19 passed.
  • Linux: cargo clippy --all-targets --features test-utils -- -D warnings passed.
  • Linux: cargo check --no-default-features --lib --bin codeg-server passed.
  • Native macOS GUI close-while-fullscreen was not exercised here.

Closes #507

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macos系统下全屏点击关闭没有正确关闭

1 participant