File tree Expand file tree Collapse file tree
app/src/processing/app/tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,6 +86,16 @@ public void run() {
8686 PrintWriter writer = PApplet .createWriter (file );
8787 writer .println ("#!/bin/sh" );
8888
89+
90+ writer .print ("\n # We don't want to steal focus for headless runs. See issue #3996.\n " +
91+ "OPTION_FOR_HEADLESS_RUN=\" \" \n " +
92+ "for ARG in \" $@\" \n " +
93+ "do\n " +
94+ " if [ $ARG = \" --build\" ]; then\n " +
95+ " OPTION_FOR_HEADLESS_RUN=\" -Djava.awt.headless=true\" \n " +
96+ " fi\n " +
97+ "done\n \n " );
98+
8999 String javaRoot = Platform .getContentFile ("." ).getCanonicalPath ();
90100
91101 StringList jarList = new StringList ();
@@ -97,6 +107,7 @@ public void run() {
97107 writer .println ("cd \" " + javaRoot + "\" && " +
98108 Platform .getJavaPath () +
99109 " -Djna.nosys=true" +
110+ " $OPTION_FOR_HEADLESS_RUN" +
100111 " -cp \" " + classPath + "\" " +
101112 " processing.mode.java.Commander \" $@\" " );
102113 writer .flush ();
You can’t perform that action at this time.
0 commit comments