mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 00:50:31 +00:00
Native lib loading fixes
This commit is contained in:
parent
215b461a65
commit
ed8ba0e27f
2 changed files with 21 additions and 3 deletions
|
@ -33,6 +33,6 @@ public class NativeMacOsWindowControl {
|
|||
return;
|
||||
}
|
||||
|
||||
NativeBridge.MacOsLibrary.INSTANCE.setAppearance(new NativeLong(nsWindow), seamlessFrame, darkMode);
|
||||
NativeBridge.getMacOsLibrary().setAppearance(new NativeLong(nsWindow), seamlessFrame, darkMode);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,9 +9,27 @@ import java.util.Map;
|
|||
|
||||
public class NativeBridge {
|
||||
|
||||
public static interface MacOsLibrary extends Library {
|
||||
private static MacOsLibrary macOsLibrary;
|
||||
|
||||
public static MacOsLibrary INSTANCE = Native.load("xpipe_bridge", MacOsLibrary.class, Map.of());
|
||||
public static MacOsLibrary getMacOsLibrary() {
|
||||
if (macOsLibrary == null) {
|
||||
try {
|
||||
var l = Native.load("xpipe_bridge", MacOsLibrary.class, Map.of());
|
||||
macOsLibrary = l;
|
||||
} catch (Throwable t) {
|
||||
ErrorEvent.fromThrowable(t).handle();
|
||||
macOsLibrary = new MacOsLibrary() {
|
||||
@Override
|
||||
public void setAppearance(NativeLong window, boolean seamlessFrame, boolean dark) {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
return macOsLibrary;
|
||||
}
|
||||
|
||||
public static interface MacOsLibrary extends Library {
|
||||
|
||||
public abstract void setAppearance(NativeLong window, boolean seamlessFrame, boolean dark);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue