Hey guys, Im having trouble lately with my newly installed kubuntu on my hp 15s with intel iris xe. Currently im using fractional scaling of 125% and I seem to expirience problems on xorg particularly with the scaling of the NetBeans IDE and OpenJDK. The IDE doesnt seem to exactly follow the system fractional scaling, specifically the toolbar buttons and ui icons are uncomfortably small on a normal ui text and its a mess…When I tried using
export _JAVA_OPTIONS=“-Dsun.java2d.uiScale=1.5 -Dsun.java2d.font.uiScale=1.5”
or putting it on NetBeans startup flags, nothing happens, it just goes back to scaling 1…basically java on kde only scales to 1 being small and 2 being huge. On the other hand, on wayland by selecting " let system scale apps" netbeans is scaled fine but its verry blurry and uncomfortable to use. Basically I want to find a way to force scale java apps to 1.5 without java always rounding it to eather 1 or 2 on xorg.
Thats weird because back then when I was on gnome xorg I had managed to fix it somehow but here is a different story and all java apps are like this, not just netbeans
Likely what’s going on is that Java has some internal setting that looks at GTK config keys, and your experimentation on GNOME happened to uncover that and manipulate the right key. If you can find it, you may be able to set it in your Plasma environment too.
However this does nothing to change my conclusion that it’s a bug in the app (or toolkit!) for not supporting fractional scaling properly out of the box!
I came across this thread a couple of days ago and wanted to check a few things before responding. Here’s what I’ve discovered from extensive reading and testing.
First, I’m using Debian Trixie so any mention of KDE is the particular version that comes with that - I fully realise things may have changed in subsequent releases.
It seems that KDE (as of $VERSION in Trixie) does not currently scale X apps on Wayland correctly. As such, the original attempt to scale by 1.5 would be interpreted as either 1 or 2. I’ve found a moderate work around by setting the following:
-J-Dsun.java2d.uiScale=2 -J-Dflatlaf.uiScale=0.75
This at least brings the UI elements down to a manageable size. The loader script for NB29 recognises it’s running on KDE and sets a flag for font aliasing, so you should have sharp text when allowing the application to scale itself (in the KDE settings). Then I set the editor font to 10pts which gives me a vaguely usable interface. Please note I’m using a 32” 4k monitor, so if your monitor size is larger or smaller you may want to play with the flatlaf scale and font size.
I’ve rebuilt my laptop with a clean Debian Trixie install (to get rid of all the faffing about I’ve been doing to check things) with Gnome as I’ve read that as of Gnome 48, the default in Trixie, mutter (which handles both Wayland and X) correctly scales X apps on Wayland. I’ve just finished checking this with my laptop plugged into my 4k and can confirm it scales perfectly based on my Gnome settings - no additional work required.
I’ve read that KDE is already working on updates that may resolve this behaviour so the flags are no longer necessary. They may even exist in a version more recent than Trixie - I haven’t checked!