summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-09-24 16:56:46 +0000
committerDana Jansens <danakj@orodu.net>2003-09-24 16:56:46 +0000
commit4cf0d783f741cd1462f36bd03ef7fa9908975d3d (patch)
treed3f257c57420ce65ebc68fde6b7b7135617b20d0 /openbox
parente5f61d3d990ac0caa331da36ab42cbda693ad006 (diff)
insert timers in the correct order
Diffstat (limited to 'openbox')
-rw-r--r--openbox/mainloop.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/openbox/mainloop.c b/openbox/mainloop.c
index 6b931957..284de04b 100644
--- a/openbox/mainloop.c
+++ b/openbox/mainloop.c
@@ -507,14 +507,14 @@ static void insert_timer(ObMainLoop *loop, ObMainLoopTimer *ins)
{
GSList *it;
for (it = loop->timers; it; it = g_slist_next(it)) {
- ObMainLoopTimer *t = it->data;
- if (timecompare(&ins->timeout, &t->timeout) <= 0) {
- loop->timers = g_slist_insert_before(loop->timers, it, ins);
- break;
- }
+ ObMainLoopTimer *t = it->data;
+ if (timecompare(&ins->timeout, &t->timeout) >= 0) {
+ loop->timers = g_slist_insert_before(loop->timers, it, ins);
+ break;
+ }
}
if (it == NULL) /* didnt fit anywhere in the list */
- loop->timers = g_slist_append(loop->timers, ins);
+ loop->timers = g_slist_append(loop->timers, ins);
}
void ob_main_loop_timeout_add(ObMainLoop *loop,
@@ -609,7 +609,7 @@ static void timer_dispatch(ObMainLoop *loop, GTimeVal **wait)
/* the queue is sorted, so if this timer shouldn't fire, none are
ready */
- if (timecompare(&NEAREST_TIMEOUT(loop), &loop->now) <= 0)
+ if (timecompare(&NEAREST_TIMEOUT(loop), &loop->now) < 0)
break;
/* we set the last fired time to delay msec after the previous firing,