diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2016-05-11 20:56:59 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2016-05-11 20:56:59 +0000 |
commit | 25aaa350d0cdd7409aecfc6d1548ec96c541bd7c (patch) | |
tree | 0c584ebe4d668d9d34ad29f7728e62a700fc202b | |
parent | ca0d63fc6118eaa26bf279b81197d08386beb69b (diff) |
Add on alerts rather than ignoring them if the event has already been
queued, for example bell and activity together. From Marcel Lippmann via
Romain Francoise.
-rw-r--r-- | usr.bin/tmux/alerts.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/tmux/alerts.c b/usr.bin/tmux/alerts.c index 24fa330d62d..cc0412598ae 100644 --- a/usr.bin/tmux/alerts.c +++ b/usr.bin/tmux/alerts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alerts.c,v 1.10 2016/01/19 15:59:12 nicm Exp $ */ +/* $OpenBSD: alerts.c,v 1.11 2016/05/11 20:56:58 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -163,15 +163,15 @@ alerts_queue(struct window *w, int flags) if (!event_initialized(&w->alerts_timer)) evtimer_set(&w->alerts_timer, alerts_timer, w); - if (!alerts_fired) { + if ((w->flags & flags) != flags) { 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; - } + 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; } } |