summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2019-04-02 22:33:24 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2019-04-13 11:57:58 +0200
commita5d8ca5cbf21f64f8e1f465fcca56ef916ea717b (patch)
tree117a6062474d7a548ac79ab64d1ee18b9a701ed6
parentd9aea39713d1fee9e0293174013dffa24a800c41 (diff)
downloadcalcurse-a5d8ca5cbf21f64f8e1f465fcca56ef916ea717b.tar.gz
calcurse-a5d8ca5cbf21f64f8e1f465fcca56ef916ea717b.zip
Fix one-second warning period for notifications
Adresses GitHub issue #204, the interactive part. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r--src/dmon.c2
-rw-r--r--src/notify.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/dmon.c b/src/dmon.c
index 69bc77a..dc8aa0c 100644
--- a/src/dmon.c
+++ b/src/dmon.c
@@ -188,7 +188,7 @@ void dmon_start(int parent_exit_status)
DMON_ABRT(_("error loading next appointment\n"));
left = notify_time_left();
- if (left > 0 && left < nbar.cntdwn
+ if (left > 0 && left <= nbar.cntdwn
&& notify_needs_reminder()) {
DMON_LOG(_("launching notification at %s for: \"%s\"\n"),
nowstr(), notify_app_txt());
diff --git a/src/notify.c b/src/notify.c
index 312be4e..d7dc610 100644
--- a/src/notify.c
+++ b/src/notify.c
@@ -285,7 +285,7 @@ void notify_update_bar(void)
hours_left * HOURINSEC) / MININSEC;
pthread_mutex_lock(&nbar.mutex);
- blinking = time_left < nbar.cntdwn && notify_trigger();
+ blinking = time_left <= nbar.cntdwn && notify_trigger();
WINS_NBAR_LOCK;
if (blinking)