version 1.3, 2015/09/21 09:34:52 |
version 1.4, 2015/10/27 15:58:42 |
|
|
struct session *s; |
struct session *s; |
|
|
if (flags & WINDOW_ACTIVITY) { |
if (flags & WINDOW_ACTIVITY) { |
if (options_get_number(&w->options, "monitor-activity")) |
if (options_get_number(w->options, "monitor-activity")) |
return (1); |
return (1); |
} |
} |
if (flags & WINDOW_SILENCE) { |
if (flags & WINDOW_SILENCE) { |
if (options_get_number(&w->options, "monitor-silence") != 0) |
if (options_get_number(w->options, "monitor-silence") != 0) |
return (1); |
return (1); |
} |
} |
if (~flags & WINDOW_BELL) |
if (~flags & WINDOW_BELL) |
|
|
RB_FOREACH(s, sessions, &sessions) { |
RB_FOREACH(s, sessions, &sessions) { |
if (!session_has(s, w)) |
if (!session_has(s, w)) |
continue; |
continue; |
if (options_get_number(&s->options, "bell-action") != BELL_NONE) |
if (options_get_number(s->options, "bell-action") != BELL_NONE) |
return (1); |
return (1); |
} |
} |
return (0); |
return (0); |
|
|
event_del(&w->alerts_timer); |
event_del(&w->alerts_timer); |
|
|
timerclear(&tv); |
timerclear(&tv); |
tv.tv_sec = options_get_number(&w->options, "monitor-silence"); |
tv.tv_sec = options_get_number(w->options, "monitor-silence"); |
|
|
log_debug("@%u alerts timer reset %u", w->id, (u_int)tv.tv_sec); |
log_debug("@%u alerts timer reset %u", w->id, (u_int)tv.tv_sec); |
if (tv.tv_sec != 0) |
if (tv.tv_sec != 0) |
|
|
if (s->curw->window == w) |
if (s->curw->window == w) |
w->flags &= ~WINDOW_BELL; |
w->flags &= ~WINDOW_BELL; |
|
|
action = options_get_number(&s->options, "bell-action"); |
action = options_get_number(s->options, "bell-action"); |
if (action == BELL_NONE) |
if (action == BELL_NONE) |
return (0); |
return (0); |
|
|
visual = options_get_number(&s->options, "visual-bell"); |
visual = options_get_number(s->options, "visual-bell"); |
TAILQ_FOREACH(c, &clients, entry) { |
TAILQ_FOREACH(c, &clients, entry) { |
if (c->session != s || c->flags & CLIENT_CONTROL) |
if (c->session != s || c->flags & CLIENT_CONTROL) |
continue; |
continue; |
|
|
if (s->curw == wl && !(s->flags & SESSION_UNATTACHED)) |
if (s->curw == wl && !(s->flags & SESSION_UNATTACHED)) |
return (0); |
return (0); |
|
|
if (!options_get_number(&w->options, "monitor-activity")) |
if (!options_get_number(w->options, "monitor-activity")) |
return (0); |
return (0); |
|
|
if (options_get_number(&s->options, "bell-on-alert")) |
if (options_get_number(s->options, "bell-on-alert")) |
alerts_ring_bell(s); |
alerts_ring_bell(s); |
wl->flags |= WINLINK_ACTIVITY; |
wl->flags |= WINLINK_ACTIVITY; |
|
|
if (options_get_number(&s->options, "visual-activity")) { |
if (options_get_number(s->options, "visual-activity")) { |
TAILQ_FOREACH(c, &clients, entry) { |
TAILQ_FOREACH(c, &clients, entry) { |
if (c->session != s) |
if (c->session != s) |
continue; |
continue; |
|
|
if (s->curw == wl && !(s->flags & SESSION_UNATTACHED)) |
if (s->curw == wl && !(s->flags & SESSION_UNATTACHED)) |
return (0); |
return (0); |
|
|
if (options_get_number(&w->options, "monitor-silence") == 0) |
if (options_get_number(w->options, "monitor-silence") == 0) |
return (0); |
return (0); |
|
|
if (options_get_number(&s->options, "bell-on-alert")) |
if (options_get_number(s->options, "bell-on-alert")) |
alerts_ring_bell(s); |
alerts_ring_bell(s); |
wl->flags |= WINLINK_SILENCE; |
wl->flags |= WINLINK_SILENCE; |
|
|
if (options_get_number(&s->options, "visual-silence")) { |
if (options_get_number(s->options, "visual-silence")) { |
TAILQ_FOREACH(c, &clients, entry) { |
TAILQ_FOREACH(c, &clients, entry) { |
if (c->session != s) |
if (c->session != s) |
continue; |
continue; |