mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Compare commits
2 commits
234048109f
...
63d9cce78e
Author | SHA1 | Date | |
---|---|---|---|
|
63d9cce78e | ||
|
05884660d7 |
3 changed files with 29 additions and 3 deletions
|
@ -6,11 +6,9 @@ import io.xpipe.app.issue.TrackEvent;
|
||||||
import io.xpipe.app.prefs.AppPrefs;
|
import io.xpipe.app.prefs.AppPrefs;
|
||||||
import io.xpipe.app.update.XPipeDistributionType;
|
import io.xpipe.app.update.XPipeDistributionType;
|
||||||
import io.xpipe.app.util.LicenseProvider;
|
import io.xpipe.app.util.LicenseProvider;
|
||||||
|
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
|
|
||||||
|
|
27
app/src/main/java/io/xpipe/app/core/AppPreloader.java
Normal file
27
app/src/main/java/io/xpipe/app/core/AppPreloader.java
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
package io.xpipe.app.core;
|
||||||
|
|
||||||
|
import io.xpipe.app.issue.TrackEvent;
|
||||||
|
import io.xpipe.core.process.OsType;
|
||||||
|
import javafx.application.Preloader;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public class AppPreloader extends Preloader {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SneakyThrows
|
||||||
|
public void start(Stage primaryStage) {
|
||||||
|
if (OsType.getLocal() != OsType.LINUX) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do it this way to prevent IDE inspections from complaining
|
||||||
|
var c = Class.forName(
|
||||||
|
ModuleLayer.boot().findModule("javafx.graphics").orElseThrow(), "com.sun.glass.ui.Application");
|
||||||
|
var m = c.getDeclaredMethod("setName", String.class);
|
||||||
|
m.invoke(c.getMethod("GetApplication").invoke(null), "XPipe");
|
||||||
|
TrackEvent.info("Application preloaded launched");
|
||||||
|
}
|
||||||
|
}
|
|
@ -121,7 +121,8 @@ project.ext {
|
||||||
// Disable this for now as it requires Windows 10+
|
// Disable this for now as it requires Windows 10+
|
||||||
// '-XX:+UseZGC',
|
// '-XX:+UseZGC',
|
||||||
"-Dvisualvm.display.name=XPipe",
|
"-Dvisualvm.display.name=XPipe",
|
||||||
"-Dapple.awt.application.appearance=system"
|
"-Dapple.awt.application.appearance=system",
|
||||||
|
"-Djavafx.preloader=io.xpipe.app.core.AppPreloader"
|
||||||
]
|
]
|
||||||
useBundledJavaFx = fullVersion
|
useBundledJavaFx = fullVersion
|
||||||
useBundledJna = fullVersion
|
useBundledJna = fullVersion
|
||||||
|
|
Loading…
Reference in a new issue