Browse Source

fixed window re-focusing on linux

Eugene Pankov 4 years ago
parent
commit
78bd90ac55
2 changed files with 5 additions and 1 deletions
  1. 1 1
      app/lib/app.ts
  2. 4 0
      app/lib/window.ts

+ 1 - 1
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()
             }

+ 4 - 0
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