hardcodet / wpf-notifyicon

NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform
Other
810 stars 125 forks source link

Bug: TrayMouseDoubleClick event not working correctly on TaskbarIcon #90

Open henon opened 1 year ago

henon commented 1 year ago

Observation:

If you don't want to use a popup and instead want to wire the TrayMouseDoubleClick event directly this doesn't work. The event is somehow only fired after a right click follows the double click.

What should happen instead:

On left mouse double click the TrayMouseDoubleClick event should be invoked.

Workaround

Until this is fixed there is a workaroud: Add a popup to the resources ...

            <Popup x:Key="Popup" Opened="OnPopupOpened">
                <Label>Popup for Dbl Click workaround due to bug</Label>
            </Popup>

... which opens correctly on left mouse double click. In the Opened event of that popup ...

        private void OnPopupOpened(object sender, EventArgs e)
        {
            var popup = sender as Popup;
            popup.IsOpen = false;
            OnTrayDoubleClick(this, new RoutedEventArgs());
        }

... we can execute our double click handler.