summaryrefslogtreecommitdiff
path: root/src/dmon.c
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2009-07-29 19:11:57 +0000
committerFrederic Culot <calcurse@culot.org>2009-07-29 19:11:57 +0000
commit5181d90b017715bab95b991f258a4df2b42263fc (patch)
tree0beec5317427947becaa8a0200515fdf33b7aa8f /src/dmon.c
parent35e4aa61c777b45bbfcd819fee09e25d1c1b1faf (diff)
downloadcalcurse-5181d90b017715bab95b991f258a4df2b42263fc.zip
Avoid multiple notifications of the same appointment when running in background.
Diffstat (limited to 'src/dmon.c')
-rw-r--r--src/dmon.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/dmon.c b/src/dmon.c
index 4a93bcb..72f4887 100644
--- a/src/dmon.c
+++ b/src/dmon.c
@@ -1,4 +1,4 @@
-/* $calcurse: dmon.c,v 1.7 2009/07/27 21:02:55 culot Exp $ */
+/* $calcurse: dmon.c,v 1.8 2009/07/29 19:11:58 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -161,6 +161,7 @@ daemonize (int status)
void
dmon_start (int parent_exit_status)
{
+ struct notify_app_s next;
conf_t conf;
if (!daemonize (parent_exit_status))
@@ -182,11 +183,12 @@ dmon_start (int parent_exit_status)
io_load_app ();
data_loaded = 1;
+ next.got_app = 0;
for (;;)
{
- struct notify_app_s next;
-
- (void)notify_get_next (&next);
+ if (!next.got_app)
+ (void)notify_get_next (&next);
+
if (next.got_app)
{
int left;
@@ -195,7 +197,10 @@ dmon_start (int parent_exit_status)
left = notify_time_left ();
if (left < nbar.cntdwn)
- notify_launch_cmd ();
+ {
+ notify_launch_cmd ();
+ next.got_app = 0;
+ }
}
if (next.txt)