mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
Native window decorations: fixed loading of native library when using JPMS for application (issue #289)
This commit is contained in:
@@ -5,11 +5,13 @@ FlatLaf Change Log
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
- Fixed crash when running in Webswing. (issue #290)
|
||||
- Native window decorations: Fixed loading of native library when using Java
|
||||
Platform Module System (JPMS) for application. (issue #289)
|
||||
- Native window decorations: Removed superfluous pixel-line at top of screen
|
||||
when window is maximized. (issue #296)
|
||||
- Button and ToggleButton: Do not paint background of disabled (and unselected)
|
||||
toolBar buttons. (issue #292; regression since fixing #112)
|
||||
- Fixed crash when running in Webswing. (issue #290)
|
||||
|
||||
|
||||
## 1.1.1
|
||||
|
||||
@@ -103,8 +103,7 @@ class FlatWindowsNativeWindowBorder
|
||||
if( SystemInfo.isX86_64 )
|
||||
libraryName += "_64";
|
||||
|
||||
nativeLibrary = new NativeLibrary( libraryName,
|
||||
FlatWindowsNativeWindowBorder.class.getClassLoader(), true );
|
||||
nativeLibrary = new NativeLibrary( libraryName, null, true );
|
||||
}
|
||||
|
||||
// check whether native library was successfully loaded
|
||||
|
||||
@@ -42,9 +42,15 @@ public class NativeLibrary
|
||||
|
||||
/**
|
||||
* Load native library from given classloader.
|
||||
* <p>
|
||||
* Note regarding Java Platform Module System (JPMS):
|
||||
* If classloader is {@code null}, the library can be only loaded from the module
|
||||
* that contains this class.
|
||||
* If classloader is not {@code null}, then the package that contains the library
|
||||
* must be specified as "open" in module-info.java of the module that contains the library.
|
||||
*
|
||||
* @param libraryName resource name of the native library (without "lib" prefix and without extension)
|
||||
* @param classLoader the classloader used to locate the library
|
||||
* @param classLoader the classloader used to locate the library, or {@code null}
|
||||
* @param supported whether the native library is supported on the current platform
|
||||
*/
|
||||
public NativeLibrary( String libraryName, ClassLoader classLoader, boolean supported ) {
|
||||
@@ -68,7 +74,9 @@ public class NativeLibrary
|
||||
libraryName = decorateLibraryName( libraryName );
|
||||
|
||||
// find library
|
||||
URL libraryUrl = classLoader.getResource( libraryName );
|
||||
URL libraryUrl = (classLoader != null)
|
||||
? classLoader.getResource( libraryName )
|
||||
: NativeLibrary.class.getResource( "/" + libraryName );
|
||||
if( libraryUrl == null ) {
|
||||
log( "Library '" + libraryName + "' not found", null );
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user