apprt/gtk: exit if there are CLI errors

This commit is contained in:
Mitchell Hashimoto
2024-10-18 08:26:17 -07:00
parent 463f4afc05
commit be3fc5c04a

View File

@ -131,6 +131,12 @@ pub fn init(core_app: *CoreApp, opts: Options) !App {
log.warn("configuration error: {s}", .{buf.items});
buf.clearRetainingCapacity();
}
// If we have any CLI errors, exit.
if (config._diagnostics.containsLocation(.cli)) {
log.warn("CLI errors detected, exiting", .{});
std.posix.exit(1);
}
}
c.gtk_init();
@ -1368,10 +1374,7 @@ fn gtkActionQuit(
ud: ?*anyopaque,
) callconv(.C) void {
const self: *App = @ptrCast(@alignCast(ud orelse return));
self.core_app.setQuit() catch |err| {
log.warn("error setting quit err={}", .{err});
return;
};
self.core_app.setQuit();
}
/// Action sent by the window manager asking us to present a specific surface to