Support running in JetBrains Projector (https://jetbrains.com/projector/)

This commit is contained in:
Karl Tauber
2021-03-17 00:43:08 +01:00
parent eafd0b3d06
commit 69ac683c8c
5 changed files with 15 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ FlatLaf Change Log
"TitlePane.unifiedBackground", true );` then window title bar and menu bar
use same background color as main content. (PR #268; issue #254)
- JIDE Common Layer: Support `JideButton`, `JideLabel` and `JideToggleButton`.
- Support running in [JetBrains Projector](https://jetbrains.com/projector/).
#### Fixed bugs

View File

@@ -157,6 +157,9 @@ public abstract class FlatLaf
*/
@Override
public boolean getSupportsWindowDecorations() {
if( SystemInfo.isProjector )
return false;
if( SystemInfo.isWindows_10_orLater &&
FlatNativeWindowBorder.isSupported() )
return false;

View File

@@ -225,6 +225,10 @@ public class FlatNativeWindowBorder
if( !SystemInfo.isWindows_10_orLater )
return;
// do not use when running in JetBrains Projector
if( SystemInfo.isProjector )
return;
// check whether disabled via system property
if( !FlatSystemProperties.getBoolean( FlatSystemProperties.USE_WINDOW_DECORATIONS, true ) )
return;

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" ) )
if( !isOptionEnabled( owner, contents, FlatClientProperties.POPUP_DROP_SHADOW_PAINTED, "Popup.dropShadowPainted" ) || SystemInfo.isProjector )
return new NonFlashingPopup( getPopupForScreenOfOwner( owner, contents, x, y, forceHeavyWeight ), contents );
// macOS and Linux adds drop shadow to heavy weight popups

View File

@@ -54,6 +54,9 @@ public class SystemInfo
// UI toolkits
public static final boolean isKDE;
// other
public static final boolean isProjector;
static {
// platforms
String osName = System.getProperty( "os.name" ).toLowerCase( Locale.ENGLISH );
@@ -85,6 +88,9 @@ public class SystemInfo
// UI toolkits
isKDE = (isLinux && System.getenv( "KDE_FULL_SESSION" ) != null);
// other
isProjector = Boolean.getBoolean( "org.jetbrains.projector.server.enable" );
}
public static long scanVersion( String version ) {