From b3d09bd972871db00a7dd023bfd0fc3df7ba59fd Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 11 Apr 2024 09:45:50 +0200 Subject: [PATCH] initial changes to replace monocle with johanvos-headless javafx branch --- build.gradle | 6 +++--- src/main/java/com/sparrowwallet/sparrow/Interface.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 86ca0781..0a560b48 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ tasks.withType(AbstractArchiveTask) { } javafx { - version = "18" + sdk = "/home/scy/git/jfx-sandbox/build/sdk" modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.swing', 'javafx.graphics' ] } @@ -198,7 +198,7 @@ application { "--add-opens=javafx.graphics/com.sun.glass.ui.mac=centerdevice.nsmenufx"] } if(headless) { - applicationDefaultJvmArgs += ["-Dglass.platform=Monocle", "-Dmonocle.platform=Headless", "-Dprism.order=sw"] + applicationDefaultJvmArgs += ["-Dglass.platform=Headless", "-Dprism.order=sw"] } } @@ -262,7 +262,7 @@ jlink { jvmArgs += ["-Dprism.lcdtext=false", "--add-opens=javafx.graphics/com.sun.glass.ui.mac=com.sparrowwallet.merged.module"] } if(headless) { - jvmArgs += ["-Dglass.platform=Monocle", "-Dmonocle.platform=Headless", "-Dprism.order=sw"] + jvmArgs += ["-Dglass.platform=Headless", "-Dprism.order=sw"] } } addExtraDependencies("javafx") diff --git a/src/main/java/com/sparrowwallet/sparrow/Interface.java b/src/main/java/com/sparrowwallet/sparrow/Interface.java index ef2c73fe..2183bba2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/Interface.java +++ b/src/main/java/com/sparrowwallet/sparrow/Interface.java @@ -8,13 +8,13 @@ public enum Interface { public static Interface get() { if(currentInterface == null) { boolean headless = java.awt.GraphicsEnvironment.isHeadless(); - boolean monocle = "Monocle".equalsIgnoreCase(System.getProperty("glass.platform")); + boolean glassHeadless = "Headless".equalsIgnoreCase(System.getProperty("glass.platform")); - if(headless || monocle) { + if(headless || glassHeadless) { currentInterface = TERMINAL; - if(headless && !monocle) { - throw new UnsupportedOperationException("Headless environment detected but Monocle platform not found"); + if(headless && !glassHeadless) { + throw new UnsupportedOperationException("Headless environment detected but Headless platform not found"); } } else { currentInterface = DESKTOP;