Native window decorations: support 32-bit JREs

This commit is contained in:
Karl Tauber
2021-03-13 23:41:38 +01:00
parent d2ccb97eba
commit 8eb44a68cb
11 changed files with 49 additions and 27 deletions

View File

@@ -144,7 +144,7 @@ public abstract class FlatLaf
* <p>
* Returns also {@code false} on Windows 10 if:
* <ul>
* <li>FlatLaf native window border support is available (requires Windows 10 64-bit)</li>
* <li>FlatLaf native window border support is available (requires Windows 10)</li>
* <li>running in
* <a href="https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime">JetBrains Runtime 11 (or later)</a>
* (<a href="https://github.com/JetBrains/JetBrainsRuntime">source code on github</a>)

View File

@@ -63,7 +63,7 @@ public interface FlatSystemProperties
* <p>
* Setting this to {@code false} disables using FlatLaf native window decorations.
* <p>
* (requires Window 10 64-bit)
* (requires Window 10)
* <p>
* <strong>Allowed Values</strong> {@code false} and {@code true}<br>
* <strong>Default</strong> none

View File

@@ -221,8 +221,8 @@ public class FlatNativeWindowBorder
return;
supported = false;
// requires Windows 10 on x86_64
if( !SystemInfo.isWindows_10_orLater || !SystemInfo.isX86_64 )
// requires Windows 10
if( !SystemInfo.isWindows_10_orLater )
return;
// check whether disabled via system property

View File

@@ -79,8 +79,8 @@ class FlatWindowsNativeWindowBorder
private static FlatWindowsNativeWindowBorder instance;
static FlatNativeWindowBorder.Provider getInstance() {
// requires Windows 10 on x86_64
if( !SystemInfo.isWindows_10_orLater || !SystemInfo.isX86_64 )
// requires Windows 10
if( !SystemInfo.isWindows_10_orLater )
return null;
// load native library
@@ -98,8 +98,11 @@ class FlatWindowsNativeWindowBorder
}
}
nativeLibrary = new NativeLibrary(
"com/formdev/flatlaf/natives/flatlaf-windows-x86_64",
String libraryName = "com/formdev/flatlaf/natives/flatlaf-windows-x86";
if( SystemInfo.isX86_64 )
libraryName += "_64";
nativeLibrary = new NativeLibrary( libraryName,
FlatWindowsNativeWindowBorder.class.getClassLoader(), true );
}
@@ -135,8 +138,8 @@ class FlatWindowsNativeWindowBorder
}
private void install( Window window ) {
// requires Windows 10 on x86_64
if( !SystemInfo.isWindows_10_orLater || !SystemInfo.isX86_64 )
// requires Windows 10
if( !SystemInfo.isWindows_10_orLater )
return;
// only JFrame and JDialog are supported