vxfw(App): re-add timers which haven't expired yet
This commit is contained in:
parent
6318b06653
commit
13e9e8ecfe
1 changed files with 5 additions and 2 deletions
|
@ -196,11 +196,14 @@ fn checkTimers(self: *App, ctx: *vxfw.EventContext) anyerror!void {
|
||||||
|
|
||||||
// timers are always sorted descending
|
// timers are always sorted descending
|
||||||
while (self.timers.popOrNull()) |tick| {
|
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;
|
break;
|
||||||
try tick.widget.handleEvent(ctx, .tick);
|
|
||||||
try self.handleCommand(&ctx.cmds);
|
|
||||||
}
|
}
|
||||||
|
try tick.widget.handleEvent(ctx, .tick);
|
||||||
|
}
|
||||||
|
try self.handleCommand(&ctx.cmds);
|
||||||
}
|
}
|
||||||
|
|
||||||
const MouseHandler = struct {
|
const MouseHandler = struct {
|
||||||
|
|
Loading…
Add table
Reference in a new issue