fixed crash when running in Webswing (issue #290)

This commit is contained in:
Karl Tauber
2021-03-30 01:06:30 +02:00
parent 477c3b6b1e
commit 7a2d0e7fcb
5 changed files with 13 additions and 4 deletions

View File

@@ -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

View File

@@ -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 &&

View File

@@ -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

View File

@@ -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

View File

@@ -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" ) );
}