diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 56419d604..4442f79db 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -529,8 +529,8 @@ pub fn startQuitTimer(self: *App) void { // This is a no-op unless we are configured to quit after last window is closed. if (!self.config.@"quit-after-last-window-closed") return; - // If a delay is configured, set a timeout function to quit after the delay. if (self.config.@"quit-after-last-window-closed-delay") |v| { + // If a delay is configured, set a timeout function to quit after the delay. const ms: u64 = std.math.divTrunc( u64, v.duration, @@ -538,6 +538,9 @@ pub fn startQuitTimer(self: *App) void { ) catch std.math.maxInt(c.guint); const t = std.math.cast(c.guint, ms) orelse std.math.maxInt(c.guint); self.quit_timer = .{ .active = c.g_timeout_add(t, gtkQuitTimerExpired, self) }; + } else { + // If no delay is configured, treat it as expired. + self.quit_timer = .{ .expired = {} }; } }