X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ftimer.c;h=e459154465ce2e615b01e3d4cd424734b91b1952;hb=2b2beddc7447197d12fcbcae96772e1f38eef138;hp=b6a82cd37fe7eba1443f3268265d70d6ffe0d4fc;hpb=0a69cfc6d2cf672634e95d5eb2015434dd924abc;p=chaz%2Fopenbox diff --git a/openbox/timer.c b/openbox/timer.c index b6a82cd3..e4591544 100644 --- a/openbox/timer.c +++ b/openbox/timer.c @@ -15,7 +15,7 @@ static long timecompare(GTimeVal *a, GTimeVal *b) long r; if ((r = b->tv_sec - a->tv_sec)) return r; - return b->tv_usec - a->tv_sec; + return b->tv_usec - a->tv_usec; } @@ -108,7 +108,7 @@ void timer_dispatch(GTimeVal **wait) /* the queue is sorted, so if this timer shouldn't fire, none are ready */ - if (timecompare(&now, &NEAREST_TIMEOUT) <= 0) + if (timecompare(&NEAREST_TIMEOUT, &now) <= 0) break; /* we set the last fired time to delay msec after the previous firing,