Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

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

Abdullah Atta690d40510372
diff --git a/apps/web/desktop/electron.js b/apps/web/desktop/electron.js
index 2d6b3217b..27dbae359 100644
--- a/apps/web/desktop/electron.js
+++ b/apps/web/desktop/electron.js
@@ -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();