JDK-8226783 : GTK is not being returned as the System L&F on Gnome.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 13
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux_ubuntu
  • Submitted: 2019-06-21
  • Updated: 2019-08-08
  • Resolved: 2019-06-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13 JDK 14
13 b28Fixed 14Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
Testsuite name: Swing manual
Test name(s): Swing_JMenu/Manual/MenuRendering
Product(s) tested:OracleJDK13b25(64bit)/tonga-4.0.2-rc2
OS/architecture:ubuntu19.04-x64
option: -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel

Actual behavior:
1.Background of menu item in test windows and native application differences.Refer to MenuRendering-native.jpg and MenuRendering-testwindow.jpg
2.The test failed as the same issue on ubuntu19.04-x64/OracleJDK13b25 without the option. 
3.The test failed as the same issue on ubuntu18.04-x64/OracleJDK13b25 with the same option.Refer to jdk13b25-ubuntu18.04-with-GTK.jpg 
Comments
Interestingly we don't seem to have a test that verifies that javax.swing.UIManager.getSystemLookAndFeelClassName()); returns what we expect. SwingSet2 just enumerates the installed L&Fs so it is happy. I'm just a bit surprised no one has noticed it running an app but it has only been a few builds.
26-06-2019

I may have found it. http://hg.openjdk.java.net/jdk/jdk/rev/bbc7c176c168 old code - if (getenv("GNOME_DESKTOP_SESSION_ID") != NULL) { new code: + -> System.getenv("GNOME_SESSION_ID")); Basically a typo but this would break finding the System L&F
26-06-2019

Someone needs to try to reproduce this using the exact steps because it makes no sense to me.
25-06-2019

Those screen shots look like Metal. Not GTK. There is nothing in the log to indicate there was a failure loading the GTK L&F. And I expect you'd have a lot of GTK test failures if it wasn't loading. This is not adding up. ALso this test calls UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); Since as I wrote above it makes no sense to be doing anything else. So your -swing.defaultlaf=<whatever> should always be ignored. So I don't understand why you are getting Metal ??
25-06-2019

The test appears to be one that ONLY makes sense if you are running the native L&F as it is trying to validate that the Swing "native" L&F looks the same as the platform menu, so the rendering you show of Metal (got without the L&F option?) makes no sense as this test should only ever run with the native L&F. So we may have a test bug here. But you also wrote : >3.The test failed as the same issue on ubuntu18.04-x64/OracleJDK13b25 with the same option which seems to mean that GTK L&F does not render correctly on 18.04. I think you need to provide screen shots of what the Swing test looks like with GTK on 18.04 and 19.04 to help us understand.
21-06-2019