desktop: exit the app if window is closed when its fullscreen on macOS

This commit is contained in:
Abdullah Atta
2023-02-14 11:42:17 +05:00
committed by Abdullah Atta
parent 6a05048aed
commit 690d405103

View File

@@ -177,7 +177,10 @@ function setupDesktopIntegration() {
if (getDesktopIntegration().closeToSystemTray) {
e.preventDefault();
if (process.platform == "darwin") {
app.hide();
// on macOS window cannot be minimized/hidden if it is already fullscreen
// so we just close it.
if (globalThis.window.isFullScreen()) app.exit(0);
else app.hide();
} else {
globalThis.window.minimize();
globalThis.window.hide();