From 2ef87dc789be16d6fbee0af0c3c0642a417ef021 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Mon, 20 Jan 2025 19:42:55 +0100 Subject: [PATCH] macOS: re-enabled rounded popup border (see PR #772) on macOS 14.4+ (was disabled in 3.5.x) deferred rounded border setup, if popup window is not yet created, could make a difference (see commit 656d25b75efa00fb769b610948672846f697434c) --- CHANGELOG.md | 2 ++ .../java/com/formdev/flatlaf/FlatSystemProperties.java | 2 +- .../java/com/formdev/flatlaf/ui/FlatPopupFactory.java | 8 +------- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 166c56d9..3f86e20c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ FlatLaf Change Log #### New features and improvements +- macOS: Re-enabled rounded popup border (see PR #772) on macOS 14.4+ (was + disabled in 3.5.x). - CheckBox: Support styling indeterminate state of [tri-state check boxes](https://www.javadoc.io/doc/com.formdev/flatlaf-extras/latest/com/formdev/flatlaf/extras/components/FlatTriStateCheckBox.html). (PR #936; issue #919) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatSystemProperties.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatSystemProperties.java index db7ccb13..d84ee855 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatSystemProperties.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatSystemProperties.java @@ -141,7 +141,7 @@ public interface FlatSystemProperties * (requires Windows 11 or macOS) *

* Allowed Values {@code false} and {@code true}
- * Default {@code true}; except on macOS 14.4+ where it is {@code false} + * Default {@code true}; except in FlatLaf 3.5.x on macOS 14.4+ where it was {@code false} * * @since 3.5.2 */ diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java index 7ab53ece..9b14bab2 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java @@ -365,14 +365,8 @@ public class FlatPopupFactory } private static boolean isMacOSBorderSupported() { - // do not use rounded border on macOS 14.4+ because it may freeze the application - // and crash the macOS WindowServer process (reports vary from Finder restarts to OS restarts) - // https://github.com/apache/netbeans/issues/7560#issuecomment-2226439215 - // https://github.com/apache/netbeans/issues/6647#issuecomment-2070124442 - boolean isMacOS_14_4_orLater = (SystemInfo.osVersion >= SystemInfo.toVersion( 14, 4, 0, 0 )); - return SystemInfo.isMacOS && - FlatSystemProperties.getBoolean( FlatSystemProperties.USE_ROUNDED_POPUP_BORDER, !isMacOS_14_4_orLater ) && + FlatSystemProperties.getBoolean( FlatSystemProperties.USE_ROUNDED_POPUP_BORDER, true ) && FlatNativeMacLibrary.isLoaded(); }