dorkbox / Utilities

Dorkbox General Utilities
Other
7 stars 3 forks source link

Incorrect screenDPI #6

Closed denuno closed 6 years ago

denuno commented 6 years ago

Found it!

https://github.com/dorkbox/Utilities/blob/3be511d91d16cc08ee6f1e50d126271eff191ae6/src/dorkbox/util/jna/linux/GtkTheme.java#L366

The debugger says that screenDPI is like -1 or some such at that point, so the returned int is 0. It got the right number from the config (1), it's just that division there... I can't edit the code easily or I'd try some stuff, but that's where I ran ashore at least.

I dunno if you wanna check things more in here, or over in SystemTray, but one or the other probably shouldn't pass back a 0, either here or there.

And apologies if I bitched a little much on the other issue. Anyone willing to wade into this area of computing is brave indeed-- I salute you sir. :vulcan_salute:

dorkbox commented 6 years ago

No worries at all about the bitching. It helps with motivation sometimes :)

Also, THANK YOU for finding this -- as I said in the other issue, if you can write a gradle script for building this, I'll use it. I spent about a day tinkering with gradle (which I know nothing about), and didn't get far enough to actually have a working build.

dorkbox commented 6 years ago

Can you see if this at least provides some sanity for this problem? If you tell me the specifics of your system, I can try to duplicate this. This is the "test" jar (running the jar shows a test icon+menu), with included (updated) sources that aren't in SystemTray 3.13.

If the sanity checking works correctly for you, then i'll make a 3.14 release with this -- granted it's not entirely necessary (since there is sanity checking inside system-tray, via your PR), but this should have sanity checking as well..

system_tray_beta.zip

denuno commented 6 years ago

The zip seemed to work, forgot to report back on that. :+1:

Trying to get stuff running on Java 9+ now, which is proving to be interesting.

Using both Notify and SystemTray is giving warnings about dorkbox.util being in both. I haven't looked into it much yet. For the time being I'll probably just mash everything into one jar to get around it.