diff options
author | 2021-11-23 09:55:04 +0100 | |
---|---|---|
committer | 2021-11-23 14:25:04 +0530 | |
commit | ebe53c3f8f6e3fe7248b0facf0a7820544666bbe (patch) | |
tree | 05775b6b1eca0423c2092b251f9befa43f06c111 /src/lib | |
parent | chore: update recipes [skip ci] (diff) | |
download | ferdium-app-ebe53c3f8f6e3fe7248b0facf0a7820544666bbe.tar.gz ferdium-app-ebe53c3f8f6e3fe7248b0facf0a7820544666bbe.tar.zst ferdium-app-ebe53c3f8f6e3fe7248b0facf0a7820544666bbe.zip |
fix: fix hiding Ferdi from systray on Macos fullscreen mode (#2264)
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Tray.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/Tray.js b/src/lib/Tray.js index b36f4de7e..655dc416f 100644 --- a/src/lib/Tray.js +++ b/src/lib/Tray.js | |||
@@ -30,7 +30,7 @@ export default class TrayIcon { | |||
30 | visible = false; | 30 | visible = false; |
31 | 31 | ||
32 | isAppMuted = false; | 32 | isAppMuted = false; |
33 | 33 | ||
34 | mainWindow = null; | 34 | mainWindow = null; |
35 | 35 | ||
36 | trayMenuTemplate = (tray) => [ | 36 | trayMenuTemplate = (tray) => [ |
@@ -65,7 +65,7 @@ export default class TrayIcon { | |||
65 | 65 | ||
66 | this.mainWindow = BrowserWindow.getAllWindows()[0]; | 66 | this.mainWindow = BrowserWindow.getAllWindows()[0]; |
67 | 67 | ||
68 | // listen to window events to be able to set correct string | 68 | // listen to window events to be able to set correct string |
69 | // to tray menu ('Hide Ferdi' / 'Show Ferdi') | 69 | // to tray menu ('Hide Ferdi' / 'Show Ferdi') |
70 | this.mainWindow.on('hide', () => { | 70 | this.mainWindow.on('hide', () => { |
71 | this._updateTrayMenu(null); | 71 | this._updateTrayMenu(null); |
@@ -143,7 +143,13 @@ export default class TrayIcon { | |||
143 | if (mainWindow.isMinimized()) { | 143 | if (mainWindow.isMinimized()) { |
144 | mainWindow.restore(); | 144 | mainWindow.restore(); |
145 | } else if (mainWindow.isVisible() && mainWindow.isFocused()) { | 145 | } else if (mainWindow.isVisible() && mainWindow.isFocused()) { |
146 | mainWindow.hide(); | 146 | if (isMac && mainWindow.isFullScreen()) { |
147 | mainWindow.once('show', () => mainWindow?.setFullScreen(true)); | ||
148 | mainWindow.once('leave-full-screen', () => mainWindow?.hide()); | ||
149 | mainWindow.setFullScreen(false); | ||
150 | } else { | ||
151 | mainWindow.hide(); | ||
152 | } | ||
147 | } else { | 153 | } else { |
148 | mainWindow.show(); | 154 | mainWindow.show(); |
149 | mainWindow.focus(); | 155 | mainWindow.focus(); |