fix(desktop): leave full screen before hiding on macOS close (#3284)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-08 17:28:58 +02:00
1 parent 46a356cc40
commit e7859fefb1
3 files changed
+158 -2

No files matched your search

+4 -2
View File
@@ -27,6 +27,7 @@ import {isNativeGatewayAvailable} from '@electron/main/GatewaySocketNativeBounda
import {shouldDisableV8CodeCache} from '@electron/main/LaunchOptions';
import {getDesktopLocalAppAuthorization} from '@electron/main/LocalAppProtocolAuthorization';
import {isLocalAppRendererDocumentURL, isLocalAppURL} from '@electron/main/LocalAppURL';
import {cancelPendingFullScreenHide, hideWindowLeavingFullScreen} from '@electron/main/MacFullScreenHide';
import {t} from '@electron/main/MainI18n';
import {MainWindowRevealGate, MainWindowRevealReason} from '@electron/main/MainWindowReveal';
import {signalMainWindowCreated, signalMainWindowReady} from '@electron/main/ModuleBootHandoff';
@@ -874,7 +875,7 @@ export function createWindow(options: CreateWindowOptions = {}): BrowserWindow {
? 'Window close hid the app. Use Quit to terminate the process'
: 'Window close hid the app to the tray. Use Quit to terminate the process',
);
mainWindow?.hide();
if (mainWindow) hideWindowLeavingFullScreen(mainWindow);
refreshDesktopTrayMenu();
}
});
@@ -1140,6 +1141,7 @@ export function showWindow(): void {
return;
}
if (mainWindow) {
cancelPendingFullScreenHide(mainWindow);
if (mainWindow.isMinimized()) {
mainWindow.restore();
}
@@ -1180,7 +1182,7 @@ export function showWindow(): void {
export function hideWindow(): void {
if (mainWindow) {
mainWindow.hide();
hideWindowLeavingFullScreen(mainWindow);
}
}