all repos — openbox @ cdd260ab2edafdc520aa4bfc01de21fac1ca130d

openbox fork - make it a bit more like ryudo

don't wait for x events if any timers fired
Dana Jansens danakj@orodu.net
commit

cdd260ab2edafdc520aa4bfc01de21fac1ca130d

parent

64ac7d053748494b3a8d0be9f1d55f6f5b9f1a90

1 files changed, 7 insertions(+), 2 deletions(-)

jump to
M otk/timer.ccotk/timer.cc

@@ -87,6 +87,11 @@ timevalAdd(curr->_last, curr->_delay);

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 @@ // wait for the nearest trigger, or for X to do something interesting

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); } }