mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 12:26:45 +00:00
initial changes to replace monocle with johanvos-headless javafx branch
This commit is contained in:
parent
86247c6440
commit
b3d09bd972
2 changed files with 7 additions and 7 deletions
|
@ -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")
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue