mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Tray.OnDoubleClick and Tray.OnClick produced at the same time #416
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @OmiCron07 on GitHub (Nov 27, 2019).
Originally assigned to: @GregorBiswanger on GitHub.
.Net Core 3.0
When subscribed to the tray events OnClick and OnDoubleClick, the two events trigger when double-clicking the tray icon. OnClick event should not trigger when double-clicking the tray icon.
@GregorBiswanger commented on GitHub (Nov 30, 2019):
I'm sorry, but that's a standard behavior of the native electron. A double-click on a tray icon should not be used normally either. See the following discussion: https://github.com/electron/electron/issues/8952
You could use at most a separate solution using reactive extensions. I see no reason to use a workaround here.
@OmiCron07 commented on GitHub (Dec 2, 2019):
Maybe the double-click should not be used in MacOS, but on Windows, all the applications in the system tray work with double-click. So, in Windows, this is a very strange behaviour because it's normal to react to single-click and double-click separately.
By the way, here my simple workaround if other faces the same problem as me:
It works by triggering the single-click event, async wait some time while the double-click gets triggered, flag as double-click event and when the single-click event resume from the wait, it detects the double-click and returns.