[fix] prevent Windows startup crashes from OpenGL failures, fixes #97

This commit is contained in:
dijunkun
2026-09-07 04:20:54 +08:00
parent 19800ef350
commit 2000654792
6 changed files with 218 additions and 0 deletions
@@ -0,0 +1,33 @@
/*
* @Author: DI JUNKUN
* @Date: 2026-09-07
* Copyright (c) 2026 by DI JUNKUN, All Rights Reserved.
*/
#ifndef _SLINT_BACKEND_H_
#define _SLINT_BACKEND_H_
#include <cstdint>
#include <string>
namespace crossdesk {
struct SlintBackendSelection {
bool success = true;
std::string backend;
std::string diagnostic;
};
inline constexpr char kSlintRendererProbeArgument[] = "--slint-renderer-probe";
// Call before creating any Slint components. The executable's main() must
// dispatch kSlintRendererProbeArgument before services, settings or the daemon.
SlintBackendSelection ConfigureWindowsSlintBackend(
uint32_t probe_timeout_ms = 10000);
// Internal child-process entry point; never call in the main application.
int RunSlintRendererProbe();
} // namespace crossdesk
#endif