Skip to content

Commit 247638a

Browse files
authored
Merge pull request #1570 from pepc84/fix/disable-awt-webgpu-only
2 parents 0d8bde5 + 76feca7 commit 247638a

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎java/src/processing/mode/java/runner/Runner.java‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ protected StringList getMachineParams() {
343343
//params.append("-Dcom.apple.mrj.application.apple.menu.about.name=" +
344344
// build.getSketchClassName());
345345

346-
if ("WEBGPU".equals(build.getSketchRenderer())) {
346+
if (PConstants.WEBGPU.equals(build.getSketchRenderer())) {
347347
params.append("-XstartOnFirstThread");
348348
}
349349
}
@@ -515,10 +515,13 @@ protected StringList getSketchParams(boolean present, String[] args) {
515515
params.append(PApplet.ARGS_UI_SCALE + "=" + uiScale);
516516
}
517517
*/
518-
519-
// TODO: excise AWT to make webgpu work properly
520-
params.append(PApplet.ARGS_DISABLE_AWT);
521-
518+
// Only disable AWT for the WebGPU renderer, which uses GLFW and
519+
// cannot coexist with AWT. All other renderers still depend on AWT
520+
// for display detection, displayWidth/displayHeight, pixelDensity(), etc.
521+
if (PConstants.WEBGPU.equals(build.getSketchRenderer())) {
522+
params.append(PApplet.ARGS_DISABLE_AWT);
523+
}
524+
522525
params.append(build.getSketchClassName());
523526
}
524527
// Add command-line arguments to be given to the sketch itself

0 commit comments

Comments
 (0)