From ebe53c3f8f6e3fe7248b0facf0a7820544666bbe Mon Sep 17 00:00:00 2001 From: Sadetdin EYILI Date: Tue, 23 Nov 2021 09:55:04 +0100 Subject: fix: fix hiding Ferdi from systray on Macos fullscreen mode (#2264) --- src/lib/Tray.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/lib/Tray.js') 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 { visible = false; isAppMuted = false; - + mainWindow = null; trayMenuTemplate = (tray) => [ @@ -65,7 +65,7 @@ export default class TrayIcon { this.mainWindow = BrowserWindow.getAllWindows()[0]; - // listen to window events to be able to set correct string + // listen to window events to be able to set correct string // to tray menu ('Hide Ferdi' / 'Show Ferdi') this.mainWindow.on('hide', () => { this._updateTrayMenu(null); @@ -143,7 +143,13 @@ export default class TrayIcon { if (mainWindow.isMinimized()) { mainWindow.restore(); } else if (mainWindow.isVisible() && mainWindow.isFocused()) { - mainWindow.hide(); + if (isMac && mainWindow.isFullScreen()) { + mainWindow.once('show', () => mainWindow?.setFullScreen(true)); + mainWindow.once('leave-full-screen', () => mainWindow?.hide()); + mainWindow.setFullScreen(false); + } else { + mainWindow.hide(); + } } else { mainWindow.show(); mainWindow.focus(); -- cgit v1.2.3-54-g00ecf