From 2a823eb3814d121f79ab3d524b3885dcfd3a52e2 Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Mon, 27 Nov 2017 02:23:27 +0100 Subject: [PATCH] Check if next_timeout is in past When having a long running notification and an additional two shorter notifications arrive. The short notification, which times out later, does not timeout correctly and gets flushed only, when the long running notification is flushed or a Focus* XEvent is sent. --- src/dunst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dunst.c b/src/dunst.c index 4b3e3f1..05ede85 100644 --- a/src/dunst.c +++ b/src/dunst.c @@ -78,7 +78,7 @@ gboolean run(void *data) gint64 timeout_at = now + sleep; if (sleep >= 0) { - if (timeout_cnt == 0 || timeout_at < next_timeout) { + if (timeout_cnt == 0 || next_timeout < now || timeout_at < next_timeout) { g_timeout_add(sleep/1000, run, mainloop); next_timeout = timeout_at; timeout_cnt++;