Skip to content

Commit 2d2ed2e

Browse files
authored
Merge pull request #1590 from session-foundation/fix/single_click_toggle_app_visibility_from_tray
fix: toggle app visibility with a single click from the tray icon
2 parents 4aa4fc7 + 759a204 commit 2d2ed2e

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

ts/node/tray_icon.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,6 @@ export function createTrayIcon(getMainWindow: () => BrowserWindow | null) {
4040
trayAny.updateContextMenu();
4141
};
4242

43-
trayAny.showWindow = () => {
44-
const mainWindow = getMainWindow();
45-
if (mainWindow) {
46-
if (!mainWindow.isVisible()) {
47-
mainWindow.show();
48-
}
49-
50-
trayAny.forceOnTop(mainWindow);
51-
}
52-
trayAny.updateContextMenu();
53-
};
54-
5543
trayAny.updateContextMenu = () => {
5644
const mainWindow = getMainWindow();
5745

@@ -75,7 +63,7 @@ export function createTrayIcon(getMainWindow: () => BrowserWindow | null) {
7563
trayAny.setContextMenu(trayContextMenu);
7664
};
7765

78-
tray.on('click', trayAny.showWindow);
66+
tray.on('click', trayAny.toggleWindowVisibility);
7967

8068
tray.setToolTip(LOCALE_DEFAULTS.app_name);
8169
trayAny.updateContextMenu();

0 commit comments

Comments
 (0)