Open lordleebo opened 6 months ago
Thanks for the bug report! Unfortunately I cannot replicate this issue on my machine - despite having almost exactly the same setup (same resolution, same OS, only 4070 instead of 1060). So we will have to find out together what's causing it...
Some questions to narrow down the possible causes:
Thank you for your effort in helping improve KSE!
Oh, I forgot: You seem to be using the "Windows" look&feel instead of the default "FlatLaf". For High DPI screens I really recommend one of the "FlatLaf" options, it probably won't help with this issue, but in general they work much better on High DPI.
Hi.
Yes I'm quite aware it does not happens to everybody, but I've been having this issue since a long time with java ui and other tools like Project Libre and Soap-UI which are java based and have the same problem, although some of these in the past worked well.
Anyways, regarding to your questions:
I really appreciate the time taken to read my report. Best regards!
JQ
El lun, 20 de may de 2024, 1:01 p. m., Kai Kramer @.***> escribió:
Thanks for the bug report! Unfortunately I cannot replicate this issue on my machine - despite having almost exactly the same setup (same resolution, same OS, only 4070 instead of 1060). So we will have to find out together what's causing it...
Some questions to narrow down the possible causes:
- Is this running in a VM (VirtualBox, VMware, Hyper-V, Parallels)?
- Are you using other Java-based software? If so, does it have the same issue?
- From what source did you get the information that this is a known bug with Java and HighDPI screens? Do you have a link?
- Did you actually try to set "-Dsun.java2d.d3d=false"? And did it help?
Thank you for your effort in helping improve KSE!
— Reply to this email directly, view it on GitHub https://github.com/kaikramer/keystore-explorer/issues/497#issuecomment-2120936759, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQT34275QFTDLOAYTCUISTZDI26HAVCNFSM6AAAAABH7YGFD6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQHEZTMNZVHE . You are receiving this because you authored the thread.Message ID: @.***>
Oh, I forgot: You seem to be using the "Windows" look&feel instead of the default "FlatLaf". For High DPI screens I really recommend one of the "FlatLaf" options, it probably won't help with this issue, but in general they work much better on High DPI.
Found something interesting, it seems the problem only happens when using windows look&feel, for other themes cannot reproduce it.
For sure we can survive without windows theme... :)
I got some news... after a while testing with FlatLaf look&feel got the problem again... :(
I got some news... after a while testing with FlatLaf look&feel got the problem again... :(
That's very unfortunate...
I am a bit reluctant to set "-Dsun.java2d.d3d=false" for all users, because it seems to have negative side effects - at least for some users.
I could make it an preference option and set it programmatically, but I am not sure if I can do this early enough during application start to have an effect.
Of course there is always the option to start KSE with "java -Dsun.java2d.d3d=false -jar kse.jar", but this is obviously not very user friendly...
I wonder what the actual cause is. I am not getting this Nvidia alert that you've mentioned, maybe I should investigate in this direction.
I assumed that you are using the Java runtime that is included in kse553-setup.exe, is that correct?
This is the nvida alert, it popup as soon as I close the tip of the day
By other hand, yes i'm using the jre included with the setup file. Maybe, instead of putting sun.java2d.d3d into nim executable, you can set the options into an external file, like most java apps do (vm.options file...) and load then into the nim executable and then launch jvm with those flags, this will allow end users to provide additional flags if needed...
Version of Java: 17.0.9.0
@lordleebo have you tried newer Java versions (21 or 22)? Maybe this issue is already fixed in newer Java versions...
Yes, currently SoapUI have same problem.
Which Java version does SoapUI run in?
Also run a lot of Jetbrains IDEs like IntelliJ, PyCharm..., Eclipse, Netbeans but it never happens with these.
JetBrains IDEs ship with there own JREs. Eclipse does not use Swing. NetBeans is Swing, but maybe you use a newer Java version to run NetBeans?
Maybe, instead of putting sun.java2d.d3d into nim executable, you can set the options into an external file, like most java apps do (vm.options file...) and load then into the nim executable and then launch jvm with those flags, this will allow end users to provide additional flags if needed...
Yes, that would also be an option. But then you could just set the environment variable "JDK_JAVA_OPTIONS" instead. In both cases you have to know that you can fix the issue like that. If I add it to the preferences, there could be a description stating that it fixes possible UI issues that can happen in combination with Nvidia graphics.
Another option would be to add a FAQ section to the KSE website and suggest setting the env variable JDK_JAVA_OPTIONS to "-Dsun.java2d.d3d=false" as a workaround.
Also a good question what @DevCharly asked, maybe a newer Java release has already fixed the issue.
Version of Java: 17.0.9.0
@lordleebo have you tried newer Java versions (21 or 22)? Maybe this issue is already fixed in newer Java versions...
I did try (21) and the problem still there, especially with windows look and feel it happens 100% of the time, with other themes it does happen but not that often
Yes, currently SoapUI have same problem.
Which Java version does SoapUI run in?
OpenJDK 16.0.2.0
Also run a lot of Jetbrains IDEs like IntelliJ, PyCharm..., Eclipse, Netbeans but it never happens with these.
JetBrains IDEs ship with there own JREs. Eclipse does not use Swing. NetBeans is Swing, but maybe you use a newer Java version to run NetBeans?
Currently running netbeans with Java 21(Temurin), and I did find in netbeans java options this parameter -Dsun.java2d.noddraw=true, according to old docs (java 8 ) this is the same like -Dsun.java2d.d3d=false. By other hand also tried -Dsun.java2d.opengl=true which turn off Direct3D and the problem went away. It seems that the problem is related to Direct3D, according to this that's the existence reason of the -Dsun.java2d.d3d=false, I'm currently with DirectX 12, not sure about those faulty drivers they mention 20 years ago...
I tried this with Netbeans, went to config, removed -Dsun.java2d.noddraw=true and there is the same problem.
I have the exact same issue - it's very, very annoying and makes this wonderful application practically useless for many use cases.
I have the exact same issue - it's very, very annoying and makes this wonderful application practically useless for many use cases.
There is a workaround described above (setting the env variable JDK_JAVA_OPTIONS
to "-Dsun.java2d.d3d=false
"). Either apply it or wait for the release of KSE 5.6.0.
My main problem with this issue is that I cannot replicate it. I have been using 4 different Windows Laptops/PCs and 2 Windows VMs with different versions and setups during the last 2 years and have never seen these drawing issues before. So if someone knows more about the cause of this then please comment here.
My suspicion is that some setting in the Nvidia software might be responsible for this, because although OP and I have almost exactly the same setup this popup never shows up on my system:
It's triggering less often with 5.3.2, and very quickly with the latest version, e.g. when signing a key inside a jks file, using Java 17 on Windows 11 Pro.
This is the exe file including sun.java2d.noddraw=true parameter, I used nim to re-compile it, no icon, not fancy, just paste into kse installation dir, you probably may want to backup original exe file.
removed by my norton antivirus protection. has your account been hacked?
besides, I have tried the command provided above by executing java -jar against the jar file, and providing -D... in the command line. unfortunately, that did not fix the problem.
removed by my norton antivirus protection. has your account been hacked?
besides, I have tried the command provided above by executing java -jar against the jar file, and providing -D... in the command line. unfortunately, that did not fix the problem.
naaaa, well duno why norton complaining maybe it still a suspicious file if there is no signature, anyways trusting someone over internet is quite difficult these days, maybe you should try to compile it by yourself if it doesn't worth it to assume a risk, providing java flag does work but as windows integration points to exe file it will not solve anything if keystore files being opened directly from windows explorer, will work perfectly if launching jar directly from terminal like:
java -Dsun.java2d.noddraw=true -jar kse.jar
Left: jar lauchend with above command Right: regular execution with problem...
Setting the environment variable JDK_JAVA_OPTIONS is probably the better way because it works no matter how you start KSE (especially for the original kse.exe this is the only option):
This env variable exists since Java 9: https://docs.oracle.com/javase/9/tools/java.htm#GUID-3B1CE181-CD30-4178-9602-230B800D4FAE__USINGTHEJDK_JAVA_OPTIONSLAUNCHERENV-F3C0E3BA
For Java 8 there was an undocumented env variable "_JAVA_OPTIONS" that did the same thing.
To check if the Java runtime has received the settings, you can use "Help -> System Information -> Button System Properties":
Describe the bug Under specific screen/hardware conditions UI redraw fails overlapping components making it difficult for user to see properly the information and/or to use software, this is a known bug with java and high dpi screens, commonly solved by passing -Dsun.java2d.d3d=false property to JVM
To Reproduce Steps to reproduce the behavior:
Expected behavior To propely show UI
Screenshots
Environment