SystemTray
SystemTray copied to clipboard
supporting SystemTray financially
Is there a way to support this repo financially, is this something dorkbox wants?
@dorkbox Any input here? You've got a lot of people who have grown to depend on this amazing little library, but waiting 2+ years to get bugs fixed is killing us. How can you help us help you?
I will get the source ready on git, so it can be checked out and tested in a running state… Not completely fixed, but running. I currently use IntelliJ + gradle, so it’s reasonable easy to get a build compiling + running.
Where I can use help is with compatibility testing and ironing out the smaller issues.
I’ve been busy getting a (different) product release finished — which has been very time consuming, and this is next on my priority list
Some help I can use, is on MacOS i’m now getting an error (maybe either one of you have seen this, or know about this). It’s in some native code, but on previous versions of macos, I’m pretty sure it worked.
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
*** First throw call stack:
(
0 CoreFoundation 0x00000001a070eb08 __exceptionPreprocess + 240
1 libobjc.A.dylib 0x00000001a0459e14 objc_exception_throw + 60
2 CoreFoundation 0x00000001a0739a88 _CFBundleGetValueForInfoKey + 0
3 AppKit 0x00000001a3214f40 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 372
4 AppKit 0x00000001a31fff3c -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 948
5 AppKit 0x00000001a31ffb7c -[NSWindow initWithContentRect:styleMask:backing:defer:] + 56
6 AppKit 0x00000001a394d140 -[NSStatusBarWindow initForStatusItem:] + 120
7 AppKit 0x00000001a39504f0 -[NSStatusItem _initWithStatusBar:length:priority:systemInsertOrder:] + 344
8 AppKit 0x00000001a347e348 -[NSStatusBar _statusItemWithLength:withPriority:] + 72
9 jna14042468940786329299.tmp 0x000000012fd4c04c ffi_prep_closure_loc + 5744
@dorkbox Googling that error brings up quite a few results, and they all pretty much say the same thing-- you can't manipulate NSWindow drag regions (or any GUI things really) from a thread other than the Main Thread. The answers online I see are all pretty much, "Stop doing that", lol. I'm not famliar with any of this mac GUI stuff (I don't even use a Mac), but I am curious if it is referring to the JVM's "main" thread or some other native process. The stack appears to all be inside of jna native code which I also know nothing about. I guess a good starting question would be
- what code is causing this error?
- how would one reproduce it?
- Is the code being called from the JVM's
Main
thread?
Any clues on exactly what jna14042468940786329299.tmp
is and where it comes from? Is that generated by the system tray lib?
Sadly, it’s a regression of MacOS - apple has changed how things work.
I apologize for the short answers, but running on the main thread doesn’t work, and to reproduce this, one just starts the system-tray on macOS :/
Delving into apple API’s is right pain the in rear.
Hi @dorkbox, it's been a few months! Have you been able to make any progress on this one?
Sorry this took so long, but it was not easy. I have figured out what exactly is going on, and how to work-around it. macos11 (Big Sur) changed how to create UI elements.
Coupled with JPMS (which is an absolute nightmare), it really wrecked development. I want to have a release before the end of the year.
That's great news! I look forward to testing and my Mac users will be excited as well.
4.2 has been released, and should work properly on modern systems again (and with JPMS support!). Please let me know if you experience any issues, and i'll prioritize fixing them.
@dorkbox This is such great news! I am excited to test. ~~Do you know when 4.2 will show up on Maven?~~ Edit: It's there.
https://search.maven.org/artifact/com.dorkbox/SystemTray
Also, is there an upgrade guide or any breaking changes if I'm coming from 3.17?
There's no upgrade guide - the only breaking changes are if you use JavaFX or SWT; in which case there are test examples in the repo that showcase these changes. (Which were necessary because of how JPMS works)