diff --git a/CHANGELOG.md b/CHANGELOG.md index 51403c14..1b9f9e81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ FlatLaf Change Log - Slider: Styling `thumbSize` or `focusWidth` did not update slider size/layout. (PR #1074) - ToolBar: Grip disappeared when switching between Look and Feels. (issue #1075) +- macOS: Popups (menus and combobox lists) were not always hidden when window is + resized. (issue #1082) - Extras: - UI defaults inspector: Fixed NPE if color of `FlatLineBorder` is null. Also use `FlatLineBorder` line color as cell background color in "Value" column. 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 6f5c3169..04b4becc 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -310,8 +310,8 @@ public abstract class FlatLaf // install submenu usability helper subMenuUsabilityHelperInstalled = SubMenuUsabilityHelper.install(); - // install Linux popup menu canceler - if( SystemInfo.isLinux ) + // install Linux/macOS popup menu canceler + if( SystemInfo.isLinux || SystemInfo.isMacOS ) linuxPopupMenuCanceler = new LinuxPopupMenuCanceler(); // listen to desktop property changes to update UI if system font or scaling changes diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxPopupMenuCanceler.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxPopupMenuCanceler.java index ac0565eb..5b5b2653 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxPopupMenuCanceler.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxPopupMenuCanceler.java @@ -30,7 +30,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; /** - * Cancels (hides) popup menus on Linux. + * Cancels (hides) popup menus on Linux and macOS. *
* On Linux, popups are not hidden under following conditions, which results in * misplaced popups: @@ -41,7 +41,13 @@ import javax.swing.event.ChangeListener; *
+ * On Windows, popups are automatically hidden. *
* The implementation is similar to what's done in * {@code javax.swing.plaf.basic.BasicPopupMenuUI.MouseGrabber},