App: a second copy opening, or OpenGL that fails, no longer strands Window Graphics

Two copies opened close together made the second take the first's
launch-pending marker for a crash and switch Window Graphics to OpenGL.
Where OpenGL can't open a window (NVIDIA on X11: "gl not compatible with
provided surface"), every later launch then failed, with no way to reach
the setting.

The marker is now locked while its launch runs, so a locked marker is a
launch still opening, not a crash. And a window that fails to open on
OpenGL puts Window Graphics back to Automatic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
prekabreki
2026-10-08 15:03:19 +02:00
co-authored by Claude Opus 5.5
parent fbc4080f53
commit 384c8cc094
2 changed files with 53 additions and 8 deletions
+6 -1
View File
@@ -211,7 +211,12 @@ fn main() -> eframe::Result {
);
match &result {
Ok(()) => log::info!("the window closed"),
Err(e) => startup_failed(e, !on_gl && cfg!(not(target_os = "macos"))),
Err(e) => {
if on_gl {
launch_guard::opengl_failed(effectcraft_host::config_dir().as_deref());
}
startup_failed(e, !on_gl && cfg!(not(target_os = "macos")));
}
}
result
}