diff --git a/app/lib/app.ts b/app/lib/app.ts index aae8caee..8e115250 100644 --- a/app/lib/app.ts +++ b/app/lib/app.ts @@ -75,7 +75,7 @@ export class Application { } onGlobalHotkey (): void { - if (this.windows.some(x => x.isFocused())) { + if (this.windows.some(x => x.isFocused() && x.isVisible())) { for (const window of this.windows) { window.hide() } diff --git a/app/lib/window.ts b/app/lib/window.ts index c5e8300c..c67b3335 100644 --- a/app/lib/window.ts +++ b/app/lib/window.ts @@ -190,6 +190,10 @@ export class Window { return this.window.isFocused() } + isVisible (): boolean { + return this.window.isVisible() + } + hide (): void { if (process.platform === 'darwin') { // Lose focus