From 41401d09859e48b65b33e40f7b811b8a2c4d2cbb Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Wed, 28 Sep 2011 17:49:14 +0200 Subject: [PATCH] round timeout round timeout of messages and prevent 0 > timeout > 500 from being rounded to 0 --- dunst_dbus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dunst_dbus.c b/dunst_dbus.c index edcad35..8a81403 100644 --- a/dunst_dbus.c +++ b/dunst_dbus.c @@ -236,7 +236,11 @@ notify(DBusMessage *dmsg) { if(expires > 0) { - expires = expires/1000; + /* do some rounding */ + expires = (expires+500)/1000; + if(expires < 1) { + expires = 1; + } } msgqueue = append(msgqueue, msg, expires, urgency, fgcolor, bgcolor); drawmsg();