Skip to content

Commit 7bf414e

Browse files
committed
Fix some library loading issues.
1 parent 391f877 commit 7bf414e

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public static void main(String[] args) {
1010
return arguments;
1111
});
1212

13+
wv.setSize(800, 600);
1314
wv.loadURL("https://google.com");
1415

1516
// Run the webview event loop, the webview is fully disposed when this returns.

SwingExample.java renamed to src/main/java/dev/webview/SwingExample.java

File renamed without changes.

src/main/java/dev/webview/Webview.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public class Webview implements Closeable, Runnable {
3131
public static final Platform PLATFORM = Platform.get();
3232

3333
static {
34-
String toLoad = WebviewNative.runSetup();
35-
N = Native.load(toLoad, WebviewNative.class);
34+
WebviewNative.runSetup();
35+
N = Native.load("webview", WebviewNative.class);
3636
}
3737

3838
@Deprecated

src/main/java/dev/webview/WebviewNative.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ public interface WebviewNative extends Library {
1616
static final PointerByReference NULL_PTR = null;
1717

1818
@SneakyThrows
19-
static String runSetup() {
20-
String toLoad = "libwebview";
21-
19+
static void runSetup() {
2220
String[] libraries = null;
2321

2422
switch (Webview.PLATFORM) {
@@ -41,7 +39,6 @@ static String runSetup() {
4139
"webview.dll",
4240
"WebView2Loader.dll"
4341
};
44-
toLoad = "webview";
4542
break;
4643
}
4744
}
@@ -56,8 +53,6 @@ static String runSetup() {
5653
Files.write(file.toPath(), bytes);
5754
}
5855
}
59-
60-
return toLoad;
6156
}
6257

6358
static final int WV_HINT_NONE = 0;

0 commit comments

Comments
 (0)