mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
Merge pull request #2041 from jcollie/quit-delay-fix
Fix quit-after-last-window-closed=true, quit-after-last-window-closed-delay=null
This commit is contained in:
@ -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 = {} };
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user