summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2015-11-19 14:55:25 +0000
committernicm <nicm>2015-11-19 14:55:25 +0000
commit98967c5ec97feef99f8278df9c3b993bbff9c0d5 (patch)
treecdb783d98c3a973faff143a2071b34ee2fc9b185
parent82760a9960850ad33db050f3bec1ab84c55c2e30 (diff)
The activity flag could already be set, so queue the callback always (if
not already queued) rather than only if the flag is being added. Fixes a problem reported by tim@
-rw-r--r--alerts.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/alerts.c b/alerts.c
index 32e0d496..e08b183d 100644
--- a/alerts.c
+++ b/alerts.c
@@ -132,15 +132,15 @@ alerts_queue(struct window *w, int flags)
if (!event_initialized(&w->alerts_timer))
evtimer_set(&w->alerts_timer, alerts_timer, w);
- if (w->flags & flags)
- return;
- w->flags |= flags;
- log_debug("@%u alerts flags added %#x", w->id, flags);
-
- if (!alerts_fired && alerts_enabled(w, flags)) {
- log_debug("alerts check queued (by @%u)", w->id);
- event_once(-1, EV_TIMEOUT, alerts_callback, NULL, NULL);
- alerts_fired = 1;
+ if (!alerts_fired) {
+ w->flags |= flags;
+ log_debug("@%u alerts flags added %#x", w->id, flags);
+
+ if (alerts_enabled(w, flags)) {
+ log_debug("alerts check queued (by @%u)", w->id);
+ event_once(-1, EV_TIMEOUT, alerts_callback, NULL, NULL);
+ alerts_fired = 1;
+ }
}
}