aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/win.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/win.c b/src/win.c
index fe8d1b4..77d6800 100644
--- a/src/win.c
+++ b/src/win.c
@@ -1150,11 +1150,13 @@ puglUpdate(PuglWorld* world, double timeout)
st = puglDispatchWinEvents(world);
} else {
const double endTime = startTime + timeout - minWaitSeconds;
- for (double t = startTime; t < endTime; t = puglGetTime(world)) {
+ double t = startTime;
+ while (!st && t < endTime) {
if ((st = puglPollWinEvents(world, endTime - t)) ||
(st = puglDispatchWinEvents(world))) {
break;
}
+ t = puglGetTime(world);
}
}