diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-05 07:22:37 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-05 07:22:37 +0000 |
| commit | cdd260ab2edafdc520aa4bfc01de21fac1ca130d (patch) | |
| tree | ce85dfb5f28d183ce3f5555cf194fd01f50bac3e /otk/timer.cc | |
| parent | 64ac7d053748494b3a8d0be9f1d55f6f5b9f1a90 (diff) | |
don't wait for x events if any timers fired
Diffstat (limited to 'otk/timer.cc')
| -rw-r--r-- | otk/timer.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/otk/timer.cc b/otk/timer.cc index ceee8f2a..4f993616 100644 --- a/otk/timer.cc +++ b/otk/timer.cc @@ -87,6 +87,11 @@ void Timer::dispatchTimers(bool wait) curr->_action(curr->_data); timevalAdd(curr->_timeout, curr->_delay); _q.push(curr); + + /* if at least one timer fires, then don't wait on X events, as there may + already be some in the queue from the timer callbacks. + */ + wait = false; } if (wait) { @@ -94,9 +99,9 @@ void Timer::dispatchTimers(bool wait) fd = ConnectionNumber(**display); FD_ZERO(&selset); FD_SET(fd, &selset); - if (nearestTimeout(next)) + if (nearestTimeout(next)) { select(fd + 1, &selset, NULL, NULL, &next); - else + } else select(fd + 1, &selset, NULL, NULL, NULL); } } |
