Compare commits

...

2 commits

Author SHA1 Message Date
crschnick
63d9cce78e Only set wmclass on linux 2024-05-09 15:00:21 +00:00
crschnick
05884660d7 Set wmclass name 2024-05-09 14:51:57 +00:00
3 changed files with 29 additions and 3 deletions

View file

@ -6,11 +6,9 @@ import io.xpipe.app.issue.TrackEvent;
import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.update.XPipeDistributionType;
import io.xpipe.app.util.LicenseProvider;
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.stage.Stage;
import lombok.Getter;
import lombok.SneakyThrows;

View 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");
}
}

View file

@ -121,7 +121,8 @@ project.ext {
// Disable this for now as it requires Windows 10+
// '-XX:+UseZGC',
"-Dvisualvm.display.name=XPipe",
"-Dapple.awt.application.appearance=system"
"-Dapple.awt.application.appearance=system",
"-Djavafx.preloader=io.xpipe.app.core.AppPreloader"
]
useBundledJavaFx = fullVersion
useBundledJna = fullVersion