Handy icon indicating copy to clipboard operation
Handy copied to clipboard

feat: add double-click support for tray icon

Open olejsc opened this issue 1 month ago • 6 comments

Adds double click support to open application from system tray.

Tested locally on Windows NOT tested on MacOS. Code for that is experimental. Would be neat if someone on MacOS could verify that it works. Ref. discussion #368

Simple GIF demo: demo-double-click-handy-tray-icon

I dont know if this is desired behaviour, as the auther hasn't expressed any opinions on this. Feel free to reject if this is out of scope for the application 😊 Disclaimer; the code changes was made partially with AI support.

olejsc avatar Nov 21 '25 19:11 olejsc

Hm is the manual click tracking necessary considering Tauri has the built in double click event?

ThioJoe avatar Nov 21 '25 20:11 ThioJoe

Hm is the manual click tracking necessary considering Tauri has the built in double click event?

I tried with the double click event, but it fired for a single click then for me 🤔

olejsc avatar Nov 21 '25 21:11 olejsc

This doesn't seem to change any behaviour on macOS, which is probably correct because I wouldn't expect a menubar item to open an app's settings window. The current behaviour (opening a menu) is pretty normal for this kinda app.

dannysmith avatar Nov 22 '25 17:11 dannysmith

Yea for macOS I don't think apps usually have a double click event in the top tray thing. It's mostly a windows thing but pretty common.

I tried with the double click event, but it fired for a single click then for me 🤔

Do you mean the menu shows with a single left click, or it made it fire the double-click app just when left clicking once?

@olejsc If the former I bet it is because of this line: https://github.com/cjpais/Handy/pull/369/files#diff-eabcebd0ae5c9b77a5247e1bdbdb88b1869fc0c932d0ef0cf2ecf9ee5221be7cL157

.show_menu_on_left_click(true)

Even if it's the latter it might be interfering with the event somehow. Probably better to just set that to false in any case, if the double left click event is added. I assume right click will still show the menu.

ThioJoe avatar Nov 25 '25 17:11 ThioJoe

@olejsc would be nice if you could try @ThioJoe suggestion, i think it would be preferable

cjpais avatar Nov 27 '25 10:11 cjpais

@olejsc would be nice if you could try @ThioJoe suggestion, i think it would be preferable

Will do when i have some time. Hopefully this weekend.

olejsc avatar Nov 27 '25 21:11 olejsc