Skip to content

Commit afc0e02

Browse files
committed
Override desktop check when setting look and feel on linux
The swing UIManager class detects the correct look and feel settings by looking inside the `sun.desktop` system property, here's the extract of the JDK: String desktop = AccessController.doPrivileged(new GetPropertyAction("sun.desktop")); Toolkit toolkit = Toolkit.getDefaultToolkit(); if ("gnome".equals(desktop) && toolkit instanceof SunToolkit && ((SunToolkit) toolkit).isNativeGTKAvailable()) { // May be set on Linux and Solaris boxs. return "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; } Since we want always the GTK look and feel (even if the desktop is not strictly a GNOME desktop) we force the `sun.desktop` property always to `gnome`.
1 parent 0458770 commit afc0e02

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arduino-core/src/processing/app/linux/Platform.java

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public class Platform extends processing.app.Platform {
3939

4040
@Override
4141
public void setLookAndFeel() throws Exception {
42+
// Override desktop check
43+
System.setProperty("sun.desktop", "gnome");
4244
super.setLookAndFeel();
4345
GTKLookAndFeelFixer.installGtkPopupBugWorkaround();
4446
}

0 commit comments

Comments
 (0)