diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-11-19 14:55:26 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-11-19 14:55:26 +0000 |
commit | 9b1eeb280d840d864dcfa37749ad84b28593145d (patch) | |
tree | e6a95e7d7ffa473407ccf7c055c76aa098e37768 /usr.bin/tmux/alerts.c | |
parent | 9f73493190e19398d42d3cd4970c7efd28bd0d18 (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@
Diffstat (limited to 'usr.bin/tmux/alerts.c')
-rw-r--r-- | usr.bin/tmux/alerts.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/tmux/alerts.c b/usr.bin/tmux/alerts.c index cfe1a5d3ccd..c4036c5eb75 100644 --- a/usr.bin/tmux/alerts.c +++ b/usr.bin/tmux/alerts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alerts.c,v 1.5 2015/11/18 14:27:44 nicm Exp $ */ +/* $OpenBSD: alerts.c,v 1.6 2015/11/19 14:55:25 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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) { + 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_enabled(w, flags)) { + log_debug("alerts check queued (by @%u)", w->id); + event_once(-1, EV_TIMEOUT, alerts_callback, NULL, NULL); + alerts_fired = 1; + } } } |