From 5b02c4d3304a570562d4dd089e46624a58697f1f Mon Sep 17 00:00:00 2001 From: skoruppa Date: Fri, 8 Mar 2019 18:04:25 +0200 Subject: fix(Linux): Fix minimized window focusing (#1304) (@skoruppa) * trigger build * Check if window is minimized before restoring it * restore() should be executed only when window is minimized --- src/lib/Tray.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/lib/Tray.js') diff --git a/src/lib/Tray.js b/src/lib/Tray.js index 669b02709..192e24796 100644 --- a/src/lib/Tray.js +++ b/src/lib/Tray.js @@ -22,7 +22,11 @@ export default class TrayIcon { { label: 'Show Franz', click() { + if (app.mainWindow.isMinimized()) { + app.mainWindow.restore(); + } app.mainWindow.show(); + app.mainWindow.focus(); }, }, { label: 'Quit Franz', @@ -36,7 +40,11 @@ export default class TrayIcon { this.trayIcon.setContextMenu(trayMenu); this.trayIcon.on('click', () => { + if (app.mainWindow.isMinimized()) { + app.mainWindow.restore(); + } app.mainWindow.show(); + app.mainWindow.focus(); }); if (process.platform === 'darwin') { -- cgit v1.2.3-54-g00ecf