From bd5b08f314ddaddb9b079b3d10b6928d28962df5 Mon Sep 17 00:00:00 2001 From: karasu Date: Wed, 11 Sep 2024 11:52:20 +0800 Subject: [PATCH] fix: exit full screen before hiding window (#341) --- src/main/window.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/window.ts b/src/main/window.ts index 6acc6bf60..f35753503 100644 --- a/src/main/window.ts +++ b/src/main/window.ts @@ -236,7 +236,14 @@ export const createMainWindow = () => { window.on("close", (event) => { if (isMacOS) { event.preventDefault() - window.hide() + if (window.isFullScreen()) { + window.once("leave-full-screen", () => { + window.hide() + }) + window.setFullScreen(false) + } else { + window.hide() + } callGlobalContextMethod(window, "electronClose") } else {