dorkbox / SystemTray

Cross-platform SystemTray support for Swing/AWT, macOS, GtkStatusIcon, and AppIndicator on Java 8+
Other
446 stars 58 forks source link

4.1 menu items not working on macOS (tried on 2 recent versions, including Catalina) #153

Closed maztan closed 1 year ago

maztan commented 3 years ago

The tray icon appears, menu items can be clicked but the action listeners aren't called. I am using the same code as in your test code and haven't changed anything since using version 3.7 of the tray. In 4.1 it is just not working.

2021-04-14 02:32:18 [JavaFX Application Thread] DEBUG dorkbox.systemTray.SystemTray - OS: Mac OS X
2021-04-14 02:32:18 [JavaFX Application Thread] DEBUG dorkbox.systemTray.SystemTray - Arch: x86_64
2021-04-14 02:32:18 [JavaFX Application Thread] DEBUG dorkbox.systemTray.SystemTray - Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 15.0.2
2021-04-14 02:32:18 [JavaFX Application Thread] DEBUG dorkbox.systemTray.SystemTray - Is Auto sizing tray/menu? true
2021-04-14 02:32:18 [JavaFX Application Thread] DEBUG dorkbox.systemTray.SystemTray - Is JavaFX detected? true
2021-04-14 02:32:18 [JavaFX Application Thread] DEBUG dorkbox.systemTray.SystemTray - Is SWT detected? false
WARNING: GL pipe is running in software mode (Renderer ID=0x1020400)
2021-04-14 02:32:18 [JavaFX Application Thread] DEBUG s.awt.multiscreen.SunDisplayChanger - Adding listener: javax.swing.RepaintManager$DisplayChangedHandler@2908946b
2021-04-14 02:32:18 [JavaFX Application Thread] DEBUG dorkbox.systemTray.SystemTray - Java Swing L&F: Aqua
2021-04-14 02:32:18 [JavaFX Application Thread] DEBUG dorkbox.systemTray.SystemTray - Auto-detecting tray type
2021-04-14 02:32:18 [JavaFX Application Thread] DEBUG dorkbox.systemTray.SystemTray - Tray indicator image size: 18
2021-04-14 02:32:18 [JavaFX Application Thread] DEBUG dorkbox.systemTray.SystemTray - Tray menu image size: 18
dorkbox commented 3 years ago

Oh that's odd. I tested this on macos, i will double check this.

maztan commented 3 years ago

If I simply switch to version 3.17 it works again.

śr., 14 kwi 2021, 11:48 użytkownik dorkbox @.***> napisał:

Oh that's odd. I tested this on macos, i will double check this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dorkbox/SystemTray/issues/153#issuecomment-819388947, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKEFBPRHDQLULZVT6Y4VCTTIVQIDANCNFSM425AWDLA .

toggm commented 3 years ago

We have the same issue in one of our projects. The problem is that we cannot switch back to version 3.17 as this version is not compatible with jdk 16 anymore.

dorkbox commented 3 years ago

Thanks for the info.

I'm not sure what's going on yet - as my backlog is just now clearing up.

toggm commented 3 years ago

Found a temporary workaround analyzing the changes between version 3.17 and 4.1. If we use the AWT MenuItem as used in version 3.17 menu works as well on MacOs. So simply put the following before loading the SystemTray:

 if (OS.isMacOsX) {
    SystemTray.FORCE_TRAY_TYPE = TrayType.Awt
 }
 SystemTray.get()
hinca commented 3 years ago

Confirmed the issue as well as the workaround on BigSur.