aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Sadetdin EYILI <sad270@users.noreply.github.com>2021-11-23 09:55:04 +0100
committerLibravatar GitHub <noreply@github.com>2021-11-23 14:25:04 +0530
commitebe53c3f8f6e3fe7248b0facf0a7820544666bbe (patch)
tree05775b6b1eca0423c2092b251f9befa43f06c111 /src
parentchore: update recipes [skip ci] (diff)
downloadferdium-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')
-rw-r--r--src/lib/Tray.js12
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();