apprt/gtk: can manually expire our quit timer instead of 0 second timer

This commit is contained in:
Mitchell Hashimoto
2024-08-04 19:06:17 -07:00
parent 4657f30f7f
commit 656c720866

View File

@ -539,9 +539,8 @@ pub fn startQuitTimer(self: *App) void {
const t = std.math.cast(c.guint, ms) orelse 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) }; self.quit_timer = .{ .active = c.g_timeout_add(t, gtkQuitTimerExpired, self) };
} else { } else {
// If no delay is configured, we still need a 0ms timer to break out of // If no delay is configured, treat it as expired.
// g_main_context_iteration so that control returns to our code. self.quit_timer = .{ .expired = {} };
self.quit_timer = .{ .active = c.g_timeout_add(0, gtkQuitTimerExpired, self) };
} }
} }