diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-08-23 11:09:38 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-08-23 12:35:57 +0200 |
| commit | b19ad35b853640db544774a9cb90c950dda08752 (patch) | |
| tree | 3ade683db020bce13f5dd7dddf257b02d996933b | |
| parent | 62db4377d4b2b86d6e29ceb5bf10040d21530186 (diff) | |
| download | mullvadvpn-b19ad35b853640db544774a9cb90c950dda08752.tar.xz mullvadvpn-b19ad35b853640db544774a9cb90c950dda08752.zip | |
Hide the menubar window when other program captures the focus
| -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()); } |
