Set wmclass name

This commit is contained in:
crschnick 2024-05-09 14:51:57 +00:00
parent 234048109f
commit 05884660d7
3 changed files with 24 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,22 @@
package io.xpipe.app.core;
import io.xpipe.app.issue.TrackEvent;
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) {
// 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