From 0af5a291acca1dddcb83448308b71aa3e91f5b25 Mon Sep 17 00:00:00 2001 From: Leorize Date: Thu, 1 May 2025 01:36:41 -0500 Subject: [PATCH] apprt/gtk: ensure configuration is loaded on startup Restores the app configuration code removed in https://github.com/ghostty-org/ghostty/pull/6792. The was unnoticed due to `colorSchemeEvent` triggering a configuration reload if `window-theme` deviates from the default (i.e. dark mode is used). Fixes https://github.com/ghostty-org/ghostty/discussions/7206 --- src/apprt/gtk/App.zig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 72c0d7509..5373e578c 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -1291,6 +1291,13 @@ pub fn run(self: *App) !void { // Setup our actions self.initActions(); + // On startup, we want to check for configuration errors right away + // so we can show our error window. We also need to setup other initial + // state. + self.syncConfigChanges(null) catch |err| { + log.warn("error handling configuration changes err={}", .{err}); + }; + while (self.running) { _ = glib.MainContext.iteration(self.ctx, 1);