diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java index 3e99f945..b2bb4ad2 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -124,6 +124,11 @@ public abstract class FlatLaf // Windows 10 allows increasing font size independent of scaling: // Settings > Ease of Access > Display > Make text bigger (100% - 225%) desktopPropertyName = "win.messagebox.font"; + } else if( SystemInfo.IS_LINUX ) { + // Linux/Gnome allows extra scaling and larger text: + // Settings > Devices > Displays > Scale (100% or 200%) + // Settings > Universal access > Large Text (off or on, 125%) + desktopPropertyName = "gnome.Xft/DPI"; } if( desktopPropertyName != null ) { desktopPropertyListener = e -> { diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java index d673944e..a6a36c83 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/UIScale.java @@ -48,8 +48,7 @@ import javax.swing.plaf.UIResource; * * 2) user scaling mode * - * This mode is for Java 8 compatibility and can be removed when changing minimum - * required Java version to 9. + * This mode is mainly for Java 8 compatibility, but is also used on Linux. * The user scale factor is computed based on the used font. * The JRE does not scale anything. * So we have to invoke {@link #scale(float)} where necessary. @@ -166,7 +165,7 @@ public class UIScale } private static boolean isUserScalingEnabled() { - if( isSystemScalingEnabled() ) + if( isSystemScalingEnabled() && !SystemInfo.IS_LINUX ) return false; // disable user scaling if JRE scales // same as in IntelliJ IDEA