Skip to content

fix(desktop): hide window when closing from fullscreen on macOS - #3062

Open
Ketan-K17 wants to merge 1 commit into
standardnotes:mainfrom
Ketan-K17:fix/macos-fullscreen-close
Open

Ketan-K17 wants to merge 1 commit into
standardnotes:mainfrom
Ketan-K17:fix/macos-fullscreen-close

Conversation

@Ketan-K17

Copy link
Copy Markdown

First off, a small nit from a loyal user of an otherwise flawless app. Thanks for building Standard Notes!

Problem

On macOS, clicking the close button while the window is in fullscreen doesn't hide the window. It exits fullscreen and stays visible in windowed mode.

Cause

The close handler calls window.setFullScreen(false) followed immediately by window.hide(). On macOS, leaving fullscreen is asynchronous (it runs the Space transition animation), so hide() runs mid-transition and has no effect.

Fix

When the window is fullscreen, wait for the leave-full-screen event before calling hide(). The window's opacity is also set to 0 before exiting fullscreen (and restored after hiding), so the user doesn't see it shrink to windowed mode before it disappears. This is closer to how native macOS apps behave. Non-fullscreen closes are unchanged.

Testing

Tested on macOS (Apple Silicon) with a local build:

  1. Enter fullscreen, click the close button → window disappears after the Space transition and the app stays running in the Dock.
  2. Click the Dock icon → window reappears in windowed mode, fully visible.
  3. Closing a non-fullscreen window still hides it instantly.

This branch has not been deployed

No deployments
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.

1 participant