diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a64cd7d..4b649dae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ FlatLaf Change Log ================== +## 1.2-SNAPSHOT + +#### Fixed bugs + +- Fixed crash when running in Webswing. (issue #290) + + ## 1.1.1 #### New features and improvements 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 1ac47041..ad51fad8 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -157,7 +157,7 @@ public abstract class FlatLaf */ @Override public boolean getSupportsWindowDecorations() { - if( SystemInfo.isProjector || SystemInfo.isWinPE ) + if( SystemInfo.isProjector || SystemInfo.isWebswing || SystemInfo.isWinPE ) return false; if( SystemInfo.isWindows_10_orLater && diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeWindowBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeWindowBorder.java index 22e1d2e4..1d640898 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeWindowBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeWindowBorder.java @@ -242,8 +242,8 @@ public class FlatNativeWindowBorder if( !SystemInfo.isWindows_10_orLater ) return; - // do not use when running in JetBrains Projector or WinPE - if( SystemInfo.isProjector || SystemInfo.isWinPE ) + // do not use when running in JetBrains Projector, Webswing or WinPE + if( SystemInfo.isProjector || SystemInfo.isWebswing || SystemInfo.isWinPE ) return; // check whether disabled via system property 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 d26f9877..c8d119bb 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 @@ -70,7 +70,7 @@ public class FlatPopupFactory boolean forceHeavyWeight = isOptionEnabled( owner, contents, FlatClientProperties.POPUP_FORCE_HEAVY_WEIGHT, "Popup.forceHeavyWeight" ); - if( !isOptionEnabled( owner, contents, FlatClientProperties.POPUP_DROP_SHADOW_PAINTED, "Popup.dropShadowPainted" ) || SystemInfo.isProjector ) + if( !isOptionEnabled( owner, contents, FlatClientProperties.POPUP_DROP_SHADOW_PAINTED, "Popup.dropShadowPainted" ) || SystemInfo.isProjector || SystemInfo.isWebswing ) return new NonFlashingPopup( getPopupForScreenOfOwner( owner, contents, x, y, forceHeavyWeight ), contents ); // macOS and Linux adds drop shadow to heavy weight popups diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/SystemInfo.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/SystemInfo.java index c193425e..305d4ed6 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/util/SystemInfo.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/util/SystemInfo.java @@ -56,6 +56,7 @@ public class SystemInfo // other /** @since 1.1 */ public static final boolean isProjector; + /** @since 1.1.2 */ public static final boolean isWebswing; /** @since 1.1.1 */ public static final boolean isWinPE; static { @@ -92,6 +93,7 @@ public class SystemInfo // other isProjector = Boolean.getBoolean( "org.jetbrains.projector.server.enable" ); + isWebswing = (System.getProperty( "webswing.rootDir" ) != null); isWinPE = isWindows && "X:\\Windows\\System32".equalsIgnoreCase( System.getProperty( "user.dir" ) ); }