diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-08-23 14:27:01 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-08-23 14:27:01 +0200 |
| commit | 7f6d9d95e29362ab5d79a36e831df20f99c98d3c (patch) | |
| tree | 3ade683db020bce13f5dd7dddf257b02d996933b | |
| parent | 62db4377d4b2b86d6e29ceb5bf10040d21530186 (diff) | |
| parent | b19ad35b853640db544774a9cb90c950dda08752 (diff) | |
| download | mullvadvpn-7f6d9d95e29362ab5d79a36e831df20f99c98d3c.tar.xz mullvadvpn-7f6d9d95e29362ab5d79a36e831df20f99c98d3c.zip | |
Merge branch 'hide-window-on-focus-change-macos'
| -rw-r--r-- | gui/src/main/index.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 4d491a9cc8..bdfc581242 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -1336,6 +1336,13 @@ class ApplicationMain { window.on('show', () => macEventMonitor.start(eventMask, () => windowController.hide())); window.on('hide', () => macEventMonitor.stop()); + window.on('blur', () => { + // Make sure to hide the menubar window when other program captures the focus. + // But avoid doing that when dev tools capture the focus to make it possible to inspect the UI + if (window.isVisible() && !window.webContents.isDevToolsFocused()) { + windowController.hide(); + } + }); tray.on('click', () => windowController.toggle()); } |
