fix unreliable and missed timeouts

This commit is contained in:
progandy 2013-05-28 17:22:05 +02:00
parent 0b3599076b
commit dab943a702
2 changed files with 2 additions and 2 deletions

View File

@ -193,7 +193,7 @@ static int get_sleep_time(void)
max_age = MAX(max_age, notification_get_age(n));
int ttl = notification_get_ttl(n);
if (ttl > 0) {
if (ttl >= 0) {
if (have_ttl) {
min_ttl = MIN(min_ttl, ttl);
} else {

View File

@ -520,7 +520,7 @@ void notification_update_text_to_render(notification *n)
int notification_get_ttl(notification *n) {
if (n->timeout == 0) {
return 0;
return -1;
} else {
return n->timeout - (time(NULL) - n->start);
}