From 13e9e8ecfecdb663eb22864bb4b72a4f28dd5655 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Fri, 1 Nov 2024 15:34:29 -0500 Subject: [PATCH] vxfw(App): re-add timers which haven't expired yet --- src/vxfw/App.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vxfw/App.zig b/src/vxfw/App.zig index f2441bd..c21d86d 100644 --- a/src/vxfw/App.zig +++ b/src/vxfw/App.zig @@ -196,11 +196,14 @@ fn checkTimers(self: *App, ctx: *vxfw.EventContext) anyerror!void { // timers are always sorted descending while (self.timers.popOrNull()) |tick| { - if (now_ms < tick.deadline_ms) + if (now_ms < tick.deadline_ms) { + // re-add the timer + try self.timers.append(tick); break; + } try tick.widget.handleEvent(ctx, .tick); - try self.handleCommand(&ctx.cmds); } + try self.handleCommand(&ctx.cmds); } const MouseHandler = struct {