# HG changeset patch
# User andrew
# Date 1402501898 -3600
# Node ID cadc17b7e20ead881dd17a08f0df12da9dfae612
# Parent d26cf395f1f04d8e14f4f82e619079e1f598719d
PR729: GTKLookAndFeel should be the system look&feel on all GNU/Linux desktops
Summary: Return GTKLookAndFeel as the system look&feel on local GNU/Linux systems
diff -r d26cf395f1f0 -r cadc17b7e20e src/share/classes/javax/swing/UIManager.java
--- openjdk/jdk/src/share/classes/javax/swing/UIManager.java Tue Jun 10 22:37:03 2014 +0100
+++ openjdk/jdk/src/share/classes/javax/swing/UIManager.java Wed Jun 11 16:51:38 2014 +0100
@@ -606,8 +606,9 @@
} else {
String desktop = AccessController.doPrivileged(new GetPropertyAction("sun.desktop"));
Toolkit toolkit = Toolkit.getDefaultToolkit();
- if ("gnome".equals(desktop) &&
- toolkit instanceof SunToolkit &&
+ boolean gtkDesktop = "gnome".equals(desktop) ||
+ (osType == OSInfo.OSType.LINUX && SwingUtilities2.isLocalDisplay());
+ if (gtkDesktop && toolkit instanceof SunToolkit &&
((SunToolkit) toolkit).isNativeGTKAvailable()) {
// May be set on Linux and Solaris boxs.
return "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";