[11u] RFR: JDK-8247753: UIManager.getSytemLookAndFeelClassName() returns wrong value on Fedora 32

Ramanand Patil ramanand.patil at in.ibm.com
Mon Apr 19 13:54:29 UTC 2021


Hi Severin and all,
Sorry for the delays. I have adjusted the code as per the suggestions, please review the v2 webrev.
http://cr.openjdk.java.net/~rpatil/8247753/webrev.01/


Regards,
Ramanand.

-----Severin Gehwolf <sgehwolf at redhat.com> wrote: -----
To: Ramanand Patil <ramanand.patil at in.ibm.com>, jdk-updates-dev at openjdk.java.net
From: Severin Gehwolf <sgehwolf at redhat.com>
Date: 02/22/2021 06:44PM
Subject: [EXTERNAL] Re: [11u] RFR: JDK-8247753: UIManager.getSytemLookAndFeelClassName() returns wrong value on Fedora 32

Hi,

On Mon, 2021-02-22 at 06:02 +0000, Ramanand Patil wrote:
> Hi all,
> Please review the JDK11u backport of JDK-8247753:
> UIManager.getSytemLookAndFeelClassName() returns wrong value on Fedora
> 32
> Bug Link: https://bugs.openjdk.java.net/browse/JDK-8247753 
> Webrev: http://cr.openjdk.java.net/~rpatil/8247753/webrev.00/ 

 461         if (getenv("GNOME_DESKTOP_SESSION_ID") != NULL
 462             || getenv("XDG_CURRENT_DESKTOP") != NULL) {
 463             sprops.desktop = "gnome";
 464         }

This doesn't match the functionality in jdk/jdk, which only returns a
desktop value of "gnome" if XDG_CURRENT_DESKTOP contains the string,
ignoring case, "gnome".

The current patch actually fails the test if XDG_CURRENT_DESKTOP=FOO.

Suggested change:

diff --git a/src/java.base/unix/native/libjava/java_props_md.c b/src/java.base/unix/native/libjava/java_props_md.c
--- a/src/java.base/unix/native/libjava/java_props_md.c
+++ b/src/java.base/unix/native/libjava/java_props_md.c
@@ -457,9 +457,10 @@
 #endif /* MACOSX */
 
         sprops.os_arch = ARCHPROPNAME;
+        char* curr_desktop = getenv("XDG_CURRENT_DESKTOP");
 
         if (getenv("GNOME_DESKTOP_SESSION_ID") != NULL
-            || getenv("XDG_CURRENT_DESKTOP") != NULL) {
+            || (curr_desktop != NULL && strcasestr(curr_desktop, "gnome") != NULL)) {
             sprops.desktop = "gnome";
         }
         else {

Thanks,
Severin




More information about the jdk-updates-dev mailing list