re-use code to cancel old timer

This commit is contained in:
Jeffrey C. Ollie
2024-08-02 10:24:17 -05:00
parent ec0f90d1b6
commit 3a4b236e6d

View File

@ -523,11 +523,7 @@ pub fn gtkQuitTimerExpired(ud: ?*anyopaque) callconv(.C) c.gboolean {
/// This will get called when there are no more open surfaces.
pub fn startQuitTimer(self: *App) void {
// Cancel any previous timeout.
if (self.quit_timer_source) |source| {
if (c.g_source_remove(source) == c.FALSE)
log.warn("unable to remove quit timer {d}", .{source});
self.quit_timer_source = null;
}
self.cancelQuitTimer();
// 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;