summaryrefslogtreecommitdiffhomepage
path: root/gui/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src/main')
-rw-r--r--gui/src/main/index.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts
index 9163264a03..8339fb8d7a 100644
--- a/gui/src/main/index.ts
+++ b/gui/src/main/index.ts
@@ -403,6 +403,8 @@ class ApplicationMain {
break;
}
+ this.installGenericFocusHandlers(windowController);
+
if (this.shouldShowWindowOnStart() || process.env.NODE_ENV === 'development') {
windowController.show();
}
@@ -1583,6 +1585,15 @@ class ApplicationMain {
});
}
+ private installGenericFocusHandlers(windowController: WindowController) {
+ windowController.window.on('focus', () => {
+ IpcMainEventChannel.windowFocus.notify(windowController.webContents, true);
+ });
+ windowController.window.on('blur', () => {
+ IpcMainEventChannel.windowFocus.notify(windowController.webContents, false);
+ });
+ }
+
private shouldShowWindowOnStart(): boolean {
switch (process.platform) {
case 'win32':