-
Notifications
You must be signed in to change notification settings - Fork 871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double HiDPI scaling when started on JetBrains JDK #7780
Comments
If scaling is now detected correctly on JDK 17+ the extra launcher logic should be probably removed. There are going to be some edge cases with multi screen setups where not all screens need scaling etc. If it turns out that it is still needed, we might have to set btw NetBeans is currently only tested on OpenJDK re-distributions, experience may vary if you run it on forks |
Would it be possible, to change this logic into setting J2D_UISCALE=2 ? When i'm developing a desktop application, that 'exec's another GUI application, like via xdg-open, the environment of that process inherits the GDK_SCALE, and in for instance 'atril' (pdf viewer) this results in 4x scaling. I've tested it with J2D_UISCALE, and for now good results. I does not work without both J2D_UISCALE or GDK_SCALE, because then the fonts are really small. Removing this logic is an option too. All java programs on my X11-ubuntu-mate desktop suffer from small fonts, so i've set J2D_UISCALE=2 in my profile script. Because of the logic in JDK 21 (others i have not checked) the JDK ignores the GDK_SCALE when J2D_UISCALE is set. Maybe we need to suggest to HiDPI users for this combinations of factors to set the variable in the profile (during netbeans startup)? I'm not sure if this next stage in X11-ubuntu-mate scaling signalling is a permanent one, and if it is valid on on other platforms than Ubuntu 24.04.2 LTS (noble). I've had severe UI scaling issues in the past with older JDK's and older desktops. I'm willing to test new versions of the startup script. versions: |
@sijskes if you don't set
you could probably set the scaling env var to 1 if you invoke the application, no? In any case this sounds like a separate issue to me. Going to rename this issue to make it more clear that this is about JDK forks which try to influence scaling and behave differently to OpenJDK distributions. other related issue: #6185 |
yes
yes i could. or remove the variable from the environment. But if the application then runs on a platform that uses GDK_SCALE it wouldnt scale correctly.
Ok, shall i open another? |
in that case it sounds like it could be handled by the same mechanism proposed in the above linked issue |
No, it doesn't. Setting GDK_SCALE, causes X programs, invoked from program under development, to inherit this, and give 4x scaling. Removing GDK_SCALE during invocation is no option, because program invoked, at deployment stage, might need GDK_SCALE. Using J2D_UISCALE instead of GDK_SCALE limits the impact of the behaviour to java programs only. and actually works correctly for java programs. |
the launcher could check both env vars |
Shouldnt an IDE offer a environment very similar to deployment? What your are implying is fixing the IDE bugs in the software developed. |
I have nothing against J2D_UISCALE or GDK_SCALE, switching to the first might be now an option since JDK requirement is 17+ but testing has to confirm it. What the launcher should likely not do is to overwrite already set env vars when they were customized - this applies to both vars. |
I solved it by using "export J2D_UISCALE=2" in profile script. That has the least amount of impact, and works. Moving over to #8243 |
Apache NetBeans version
Apache NetBeans 23 release candidate
What happened
Netbeans 23 launcher auto-detects HiDPI and set's
GDK_SCALE=2
. However, some jdk especially 21 and JBR distributions handle scaling naively. SettingGDK_SCALE=2
in launch script results in 4x scaling.Language / Project Type / NetBeans Component
No response
How to reproduce
Use temurin jdk 21 or Jetbrain JDK 21 and luanch netbeans 23. The netbeans UI on HiDPI screen with 2x scale looks like 4x scaled.
Did this work correctly in an earlier version?
Apache NetBeans 22
Operating System
Arch Linux
JDK
21
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
Yes
The text was updated successfully, but these errors were encountered: