-
Notifications
You must be signed in to change notification settings - Fork 1
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
Graphic issues on certain GPUs #2
Comments
I don't think I can help. Looking at your comment, you seem more versed in Win32 API than me :) I can add a few more points to your findings though. On my notebook, which has an NVidia card:
At this point, I don't think it is possible to create a mica window without doing it properly on stage creation. Probably a custom stage implementation is required here, but this is too big a task for what I use JavaFX for. Sorry :( |
No problem, thanks for your hint about the background color! Unfortunately, it doesn't seem to do the same on my NVIDIA desktop, so there might be even more uncertainties. I also heard conflicting opinions on whether one has to use I'll keep investigating this issue, if you have the time feel free to let me know about any changes that you noticed! |
An additional thing that I found out: If I use |
Hi, using an undocumented
By the way,
I had a similar experience. My main machine also uses AMD so in the beginning I thought that Mica works without problems. However, I had another user running AMD where for some reason, the same code didn't work! I needed to investigate that too. But if that |
It doesn't work on mine :( But maybe I'm doing it wrong? I'm more of a sbt person than maven person. How did you pass that option? I tried setting $env:MAVEN_OPTS/$env:JAVA_OPTS, and calling setProperty in |
I'm actually mainly using Gradle, with Gradle it depends a little bit on whether it runs a In general, you could look for the way how to pass "JVM arguments" to Java. For example, in Gradle one can use But it actually should work if you use |
Turns out you can list JVM options under JavaFX plugin configuration. And it works! Well, the title text background is still opaque but it works :) |
Great to hear! I actually do not have this opaque title problem anymore, at least on my current 22H2 machine. I remember having it in the past (before 22H2), but I also put it off until later. Luckily, it seems to be gone for me, but I will look for a fix and tell you if it happens to me again. For the sake of completeness, I'll collect my data points on Mica issues here:
(1) With performance loss on monitors >60Hz. If I notice that it is driver-dependend, I'll lookup the versions and add them later. |
You can put 'yes' to both column for RX 570X. And yes, opaque background isn't an issue in 22H2, my notebook is not yet updated. |
It turns out the Mica issue that the RX 580 user had was actually me additionally using One could now simply enable In that case, also setting Here is also some additional information on what
https://bugs.openjdk.org/browse/JDK-8091385
For now I'll update the table to be more general because in the end it only seems to depend on using AMD or not. I will probably build a check for a user's GPU and enable |
👍 You're awesome. I will re-open this issue if you don't mind, just to make it a bit more visible. Who knows, maybe there is a third person on the internet that cares about JavaFX on Windows 11 🙂. |
me! 😃 |
Hi there,
I was hoping that you might help investigating an issue with the Mica effect that I noticed on certain hardware. Similar to you, I was applying Windows 11's Mica style to a JavaFX window by setting the necessary "magic" values (20 and 1029 before 22H2, now 38 on 22H2). While this works great on my main development machine, there seems to be a graphical glitch on certain hardware that make the effect look wrong. For example, with your test code:
Left is how it should look, and right is how it actually looks on another computer that uses an NVIDIA GPU. My main computer where everything works as intended uses an AMD graphics card. The scene is set to
Color.TRANSPARENT
, so it seems the "real" color of the window shines through and is black.At first I noticed this problem on a notebook that uses Intel integrated graphics. I put this on hold because I thought the 22H2 update might fix this issue. However, I now have 22H2 on both an AMD and an NVIDIA system, and the NVIDIA computer still has the same issue no matter if I use my original code or your library.
Now the interesting thing is that if I turn off hardware acceleration (
System.setProperty("prism.order, "sw")
), then both the NVIDIA and the Intel machine show the Mica effect correctly. The fact that other Windows applications (e.g. Explorer) also correctly show the Mica effect makes me think it might something internal to JavaFX---however, it seems, only on certain hardware. Would you happen to know what might be the cause of this?I investigated a little bit more and I was able to achieve something by using Windows'
SetLayeredWindowAttributes(hWnd, RGB(255, 0, 255), 0, LWA_COLORKEY);
and setting the scene background to Magenta (here showcased with my program):Again, left is how it should look, and right is how it looks on an NVIDIA system. What happens is that while the window correctly shows the Mica effect, it is completely mouse transparent, and only the magenta color is actually clickable (and of course there is this strange color fringe).
What I also found out is that other GUI toolkits are able to correctly "Mica-ify" a window on my NVIDIA system, e.g.:
https://github.com/martinet101/win32mica/
https://github.com/dongle-the-gadget/SystemBackdropTypes
However, they seem to do a little bit more than only setting
DwmSetWindowAttribute
. For example, the WPF example works with aCompositionTarget
and a transparent color here: https://github.com/dongle-the-gadget/SystemBackdropTypes/blob/ab18f1aa70f0575e5df42ebad5ae2699b2ee4c9a/SystemBackdropTypes/MainWindow.xaml.cs#L34Sadly, my knowledge about the Windows API is limited, so I wonder if you have any more insights on why this seems to be a JavaFX problem, and what exactly the drivers do different so that it only occurs on certain hardware.
The text was updated successfully, but these errors were encountered: