From b35fda43ea411461a917ef6ddfa1604423945656 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 14 Feb 2011 22:17:59 +0000 Subject: [PATCH] more changes to headless mode; now non-headless mode is used when: - YaCy runs on Windows - YaCy is started with the -gui option in all other cases YaCy runs in headless mode git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7481 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/net/yacy/yacy.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/source/net/yacy/yacy.java b/source/net/yacy/yacy.java index 7036446d7..78844dff5 100644 --- a/source/net/yacy/yacy.java +++ b/source/net/yacy/yacy.java @@ -936,12 +936,15 @@ public final class yacy { final long startupMemFree = MemoryControl.free(); final long startupMemTotal = MemoryControl.total(); - // go into headless awt mode - if (args.length >= 1 && args[0].toLowerCase().equals("-gui")) { - System.setProperty("java.awt.headless", "false"); - } else { - System.setProperty("java.awt.headless", "true"); - } + // maybe go into headless awt mode: we have three cases depending on OS and one exception: + // windows : better do not go into headless mode + // mac : go into headless mode because an application is shown in gui which may not be wanted + // linux : go into headless mode because this does not need any head operation + // exception : if the -gui option is used then do not go into headless mode since that uses a gui + boolean headless = true; + if (OS.isWindows) headless = false; + if (args.length >= 1 && args[0].toLowerCase().equals("-gui")) headless = false; + System.setProperty("java.awt.headless", headless ? "true" : "false"); String s = ""; for (String a: args) s += a + " "; yacyRelease.startParameter = s.trim();