Skip to content

Commit 98967c5

Browse files
author
nicm
committed
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@
1 parent 82760a9 commit 98967c5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

alerts.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ alerts_queue(struct window *w, int flags)
132132
if (!event_initialized(&w->alerts_timer))
133133
evtimer_set(&w->alerts_timer, alerts_timer, w);
134134

135-
if (w->flags & flags)
136-
return;
137-
w->flags |= flags;
138-
log_debug("@%u alerts flags added %#x", w->id, flags);
139-
140-
if (!alerts_fired && alerts_enabled(w, flags)) {
141-
log_debug("alerts check queued (by @%u)", w->id);
142-
event_once(-1, EV_TIMEOUT, alerts_callback, NULL, NULL);
143-
alerts_fired = 1;
135+
if (!alerts_fired) {
136+
w->flags |= flags;
137+
log_debug("@%u alerts flags added %#x", w->id, flags);
138+
139+
if (alerts_enabled(w, flags)) {
140+
log_debug("alerts check queued (by @%u)", w->id);
141+
event_once(-1, EV_TIMEOUT, alerts_callback, NULL, NULL);
142+
alerts_fired = 1;
143+
}
144144
}
145145
}
146146

0 commit comments

Comments
 (0)