mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 23:08:42 +03:00
Linux: fixed UnsatisfiedLinkError: com.formdev.flatlaf.ui.FlatNativeWindowsLibrary.getOSBuildNumberImpl() (regression in PR #643, commit 07ad467c73)
added additional platform checks to `FlatNative<platform>Library.isLoaded()` methods
This commit is contained in:
@@ -23,6 +23,7 @@ import java.awt.event.MouseEvent;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JFrame;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
|
||||
/**
|
||||
* Native methods for Linux.
|
||||
@@ -35,7 +36,7 @@ import javax.swing.JFrame;
|
||||
class FlatNativeLinuxLibrary
|
||||
{
|
||||
static boolean isLoaded() {
|
||||
return FlatNativeLibrary.isLoaded();
|
||||
return SystemInfo.isLinux && FlatNativeLibrary.isLoaded();
|
||||
}
|
||||
|
||||
// direction for _NET_WM_MOVERESIZE message
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.formdev.flatlaf.ui;
|
||||
|
||||
import java.awt.Window;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
|
||||
/**
|
||||
* Native methods for Windows.
|
||||
@@ -31,7 +32,7 @@ public class FlatNativeWindowsLibrary
|
||||
private static long osBuildNumber = Long.MIN_VALUE;
|
||||
|
||||
public static boolean isLoaded() {
|
||||
return FlatNativeLibrary.isLoaded();
|
||||
return SystemInfo.isWindows && FlatNativeLibrary.isLoaded();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -126,9 +126,9 @@ public class SystemInfo
|
||||
// For older Java versions, use native library to get OS build number.
|
||||
boolean isWin_11_orLater = false;
|
||||
try {
|
||||
isWin_11_orLater = (isWindows_10_orLater &&
|
||||
(scanVersion( StringUtils.removeLeading( osName, "windows " ) ) >= toVersion( 11, 0, 0, 0 )) ||
|
||||
(FlatNativeWindowsLibrary.isLoaded() && FlatNativeWindowsLibrary.getOSBuildNumber() >= 22000));
|
||||
isWin_11_orLater = isWindows_10_orLater &&
|
||||
(scanVersion( StringUtils.removeLeading( osName, "windows " ) ) >= toVersion( 11, 0, 0, 0 ) ||
|
||||
(FlatNativeWindowsLibrary.isLoaded() && FlatNativeWindowsLibrary.getOSBuildNumber() >= 22000));
|
||||
} catch( Throwable ex ) {
|
||||
// catch to avoid that application can not start if native library is not up-to-date
|
||||
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||
|
||||
Reference in New Issue
Block a user