mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
apprt/glfw: add logging with error information when glfw init fails
This commit is contained in:
@ -36,7 +36,17 @@ pub const App = struct {
|
|||||||
pub const Options = struct {};
|
pub const Options = struct {};
|
||||||
|
|
||||||
pub fn init(core_app: *CoreApp, _: Options) !App {
|
pub fn init(core_app: *CoreApp, _: Options) !App {
|
||||||
if (!glfw.init(.{})) return error.GlfwInitFailed;
|
if (!glfw.init(.{})) {
|
||||||
|
if (glfw.getError()) |err| {
|
||||||
|
log.err("error initializing GLFW err={} msg={s}", .{
|
||||||
|
err.error_code,
|
||||||
|
err.description,
|
||||||
|
});
|
||||||
|
return err.error_code;
|
||||||
|
}
|
||||||
|
|
||||||
|
return error.GlfwInitFailedUnknownReason;
|
||||||
|
}
|
||||||
glfw.setErrorCallback(glfwErrorCallback);
|
glfw.setErrorCallback(glfwErrorCallback);
|
||||||
|
|
||||||
// Mac-specific state. For example, on Mac we enable window tabbing.
|
// Mac-specific state. For example, on Mac we enable window tabbing.
|
||||||
|
Reference in New Issue
Block a user