leanflutter / tray_manager

This plugin allows Flutter desktop apps to defines system tray.
https://pub.dev/packages/tray_manager
MIT License
238 stars 40 forks source link

[macOS] onTrayIconMouseDown not triggered after long press #12

Closed cbenhagen closed 2 years ago

cbenhagen commented 2 years ago

To reproduce:

  1. start the example app
  2. click setIcon and setContextMenu buttons
  3. click on tray icon for 1s
  4. menu opens on mouse down and closes automatically on mouse up as expected
  5. click tray icon again
  6. notice that mouse down is not handled

Mostly the same happens if you you press the tray icon about 200ms. The menu will stay open but the next mouse down is not handled as well. The first example is just easier to reproduce but most likely due to the same issue.

cbenhagen commented 2 years ago

@lijy91 do you have an idea how this could be solved? I see that you already changed the way the menu icon clicks are handled in https://github.com/leanflutter/tray_manager/commit/55aa9377e8477b08c9f040ae877ccb7dc9121468.

In the current state the plugin can not be used unfortunately as from the users perspective the tray icon click is randomly ignored.

lijy91 commented 2 years ago

I'm refactoring this plugin to support displaying multiple tray icons. I'll look into this after the refactoring is complete

lijy91 commented 2 years ago

Please update to 0.1.5

cbenhagen commented 2 years ago

Works like a charm! Thank you so much!!