Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.

Commit dfd7651

Browse files
committed
since electron tray doesn't support double click on linux, open on single click there
1 parent 01d75bd commit dfd7651

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/main/base/app.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export class AppEvents {
280280
this.tray.setToolTip(app.getName());
281281
this.setTray(false);
282282

283-
this.tray.on("double-click", () => {
283+
this.tray.on("double-click", () => { // supports windows and mac only
284284
if (utils.getWindow()) {
285285
if (utils.getWindow().isVisible()) {
286286
utils.getWindow().focus();
@@ -290,6 +290,16 @@ export class AppEvents {
290290
}
291291
});
292292

293+
this.tray.on("click", () => {
294+
if (utils.getWindow() && process.platform === "linux") { // use single click to open when double doesn't work
295+
if (utils.getWindow().isVisible()) {
296+
utils.getWindow().focus();
297+
} else {
298+
utils.getWindow().show();
299+
}
300+
}
301+
});
302+
293303
utils.getWindow().on("show", () => {
294304
this.setTray(true);
295305
});

0 commit comments

Comments
 (0)