Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions packages/desktop/app/javascripts/Main/Window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,22 @@ export async function createWindowState({
event.preventDefault()
/**
* Handles Mac full screen issue where pressing close results
* in a black screen.
* in a black screen. Exiting full screen is asynchronous on macOS,
* so hiding must wait until the transition finishes; otherwise the
* hide is swallowed and the window is left visible in windowed mode.
* The window is made transparent first so the user doesn't see it
* shrink back to windowed mode before disappearing.
*/
if (window.isFullScreen()) {
window.setOpacity(0)
window.once('leave-full-screen', () => {
window.hide()
window.setOpacity(1)
})
window.setFullScreen(false)
} else {
window.hide()
}
window.hide()
}
})

Expand Down