windows: no console window for the release app and its children

- the oak-editor release build lacked the
  `windows_subsystem = "windows"` crate attribute, so launching the
  installed app opened a console window next to the editor (debug builds
  keep the console so `cargo run` shows logs);
- oak-worker, the OFX host and the ffmpeg/ffprobe helpers are
  console-subsystem binaries spawned by the GUI app, so each spawn now
  carries CREATE_NO_WINDOW through the shared
  oak_core::miscutils::hide_console_window helper (a no-op off Windows).
This commit is contained in:
2026-09-24 19:39:16 +08:00
parent 8f6527887d
commit c9ba8695fc
5 changed files with 70 additions and 34 deletions
+2
View File
@@ -466,6 +466,8 @@ impl OfxHost {
for (key, value) in &config.env {
command.env(key, value);
}
// A GUI Oak spawning a console child would flash a console window.
oak_core::miscutils::hide_console_window(&mut command);
let mut child = command
.spawn()
.map_err(|e| Error::Failed(format!("spawn OFX host {}: {e}", bin.display())))?;
+6 -2
View File
@@ -1950,14 +1950,18 @@ impl ProcessDispatcher {
);
let shm = ShmRegionView::create(&key, inner.slots, inner.slot_bytes)?;
let mut child = Command::new(&inner.bin)
let mut command = Command::new(&inner.bin);
command
// Auto backend: prefer the GPU, fall back to the CPU renderer
// (M16 S1 — the worker tolerates a GPU init failure and keeps
// evaluating headless).
.args(["--backend", "auto"])
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::inherit())
.stderr(Stdio::inherit());
// A GUI Oak spawning a console child would flash a console window.
oak_core::miscutils::hide_console_window(&mut command);
let mut child = command
.spawn()
.map_err(|e| Error::Failed(format!("spawn oak-worker: {e}")))?;
let stdin = child.stdin.take();