From dab943a702067a2d6ec53c66e00aed879f037f5b Mon Sep 17 00:00:00 2001 From: progandy Date: Tue, 28 May 2013 17:22:05 +0200 Subject: [PATCH] fix unreliable and missed timeouts --- dunst.c | 2 +- notification.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dunst.c b/dunst.c index e604cd0..f8f0784 100644 --- a/dunst.c +++ b/dunst.c @@ -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 { diff --git a/notification.c b/notification.c index e3d3b47..10cbd11 100644 --- a/notification.c +++ b/notification.c @@ -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); }