diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e46fcc7..58310336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ FlatLaf Change Log - Support using IntelliJ platform themes (.theme.json files). - Fixed selection background of checkbox in table cell. +- Fixed jittery submenu rendering on Mac. (issue #10) ## 0.18 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 86b2482a..8463898b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -33,6 +33,7 @@ import javax.swing.AbstractButton; import javax.swing.JLabel; import javax.swing.JTabbedPane; import javax.swing.LookAndFeel; +import javax.swing.PopupFactory; import javax.swing.SwingUtilities; import javax.swing.UIDefaults; import javax.swing.UIManager; @@ -92,6 +93,11 @@ public abstract class FlatLaf super.initialize(); + // make sure that a plain popup factory is used (otherwise sub-menu rendering + // is "jittery" on Mac, where AquaLookAndFeel installs its own popup factory) + if( PopupFactory.getSharedInstance().getClass() != PopupFactory.class ) + PopupFactory.setSharedInstance( new PopupFactory() ); + // add mnemonic listener mnemonicListener = e -> { if( e.getKeyCode() == KeyEvent.VK_ALT )