@@ -35,27 +35,10 @@ public void launch() {
3535 }
3636 ProcessBuilder pb ;
3737 if (System .getProperty ("os.name" ,"" ).toLowerCase ().contains ("mac" )) {
38- // macOS: wrap in minimal .app bundle so the process gets window server access
39- java .io .File appBundle = new java .io .File (sketchFolder , exeToRun .getName () + ".app" );
40- java .io .File macosDir = new java .io .File (appBundle , "Contents/MacOS" );
41- macosDir .mkdirs ();
42- java .io .File bundledBin = new java .io .File (macosDir , exeToRun .getName ());
43- java .nio .file .Files .copy (exeToRun .toPath (), bundledBin .toPath (),
44- java .nio .file .StandardCopyOption .REPLACE_EXISTING );
45- bundledBin .setExecutable (true );
46- // Write minimal Info.plist
47- java .io .File plist = new java .io .File (appBundle , "Contents/Info.plist" );
48- java .nio .file .Files .writeString (plist .toPath (),
49- "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n "
50- + "<!DOCTYPE plist PUBLIC \" -//Apple//DTD PLIST 1.0//EN\" \" http://www.apple.com/DTDs/PropertyList-1.0.dtd\" >\n "
51- + "<plist version=\" 1.0\" ><dict>\n "
52- + "<key>CFBundleExecutable</key><string>" + exeToRun .getName () + "</string>\n "
53- + "<key>CFBundleIdentifier</key><string>processing.cpp." + exeToRun .getName () + "</string>\n "
54- + "<key>CFBundleName</key><string>" + exeToRun .getName () + "</string>\n "
55- + "<key>NSHighResolutionCapable</key><true/>\n "
56- + "<key>NSPrincipalClass</key><string>NSApplication</string>\n "
57- + "</dict></plist>\n " );
58- pb = new ProcessBuilder ("open" , "-W" , "-n" , appBundle .getAbsolutePath ());
38+ // macOS: launch directly -- the .app bundle approach breaks stdio piping
39+ // Just run the binary directly; modern macOS allows subprocess windows
40+ // as long as the parent process has screen access (Processing does).
41+ pb = new ProcessBuilder (exeToRun .getAbsolutePath ());
5942 } else {
6043 pb = new ProcessBuilder (exeToRun .getAbsolutePath ());
6144 }
0 commit comments