From 81ff86299f4e2df0c02c634c1fa7f415bc2781dc Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Thu, 21 Sep 2017 15:33:42 +0200 Subject: [PATCH] Change boundary conditions in run() --- src/dunst.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dunst.c b/src/dunst.c index 9ed2551..20a6415 100644 --- a/src/dunst.c +++ b/src/dunst.c @@ -210,7 +210,7 @@ gboolean run(void *data) static int timeout_cnt = 0; static gint64 next_timeout = 0; - if (data) { + if (data && timeout_cnt > 0) { timeout_cnt--; } @@ -231,7 +231,7 @@ gboolean run(void *data) gint64 sleep = get_sleep_time(); gint64 timeout_at = now + sleep; - if (sleep > 0) { + if (sleep >= 0) { if (timeout_cnt == 0 || timeout_at < next_timeout) { g_timeout_add(sleep/1000, run, mainloop); next_timeout = timeout_at;