summaryrefslogtreecommitdiffstats
path: root/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-06-21 01:27:46 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-06-21 01:27:46 +0000
commite63f0546a166c442464c7d8500a74b38c036432a (patch)
treed087ac452070d41659c6e03dcb6d2f0e04079885 /status.c
parent447a07e9f83297bf0ad5f973e67eb32488fc1b8d (diff)
Having a list of winlinks->alerts for each session is stupid, just store
the alert flags directly in the winlink itself.
Diffstat (limited to 'status.c')
-rw-r--r--status.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/status.c b/status.c
index 4399ae43..b1d93c97 100644
--- a/status.c
+++ b/status.c
@@ -248,25 +248,15 @@ status_redraw(struct client *c)
*/
offset = 0;
RB_FOREACH(wl, winlinks, &s->windows) {
- if (larrow == 1 && offset < wlstart) {
- if (session_alert_has(s, wl, WINDOW_ACTIVITY))
- larrow = -1;
- else if (session_alert_has(s, wl, WINDOW_BELL))
- larrow = -1;
- else if (session_alert_has(s, wl, WINDOW_CONTENT))
- larrow = -1;
- }
+ if (wl->flags & WINLINK_ALERTFLAGS &&
+ larrow == 1 && offset < wlstart)
+ larrow = -1;
offset += wl->status_width;
- if (rarrow == 1 && offset > wlstart + wlwidth) {
- if (session_alert_has(s, wl, WINDOW_ACTIVITY))
- rarrow = -1;
- else if (session_alert_has(s, wl, WINDOW_BELL))
- rarrow = -1;
- else if (session_alert_has(s, wl, WINDOW_CONTENT))
- rarrow = -1;
- }
+ if (wl->flags & WINLINK_ALERTFLAGS &&
+ rarrow == 1 && offset > wlstart + wlwidth)
+ rarrow = -1;
}
draw:
@@ -399,11 +389,11 @@ status_replace1(struct client *c,struct winlink *wl,
goto do_replace;
case 'F':
tmp[0] = ' ';
- if (session_alert_has(s, wl, WINDOW_CONTENT))
+ if (wl->flags & WINLINK_CONTENT)
tmp[0] = '+';
- else if (session_alert_has(s, wl, WINDOW_BELL))
+ else if (wl->flags & WINLINK_BELL)
tmp[0] = '!';
- else if (session_alert_has(s, wl, WINDOW_ACTIVITY))
+ else if (wl->flags & WINLINK_ACTIVITY)
tmp[0] = '#';
else if (wl == s->curw)
tmp[0] = '*';
@@ -593,9 +583,7 @@ status_print(
fmt = options_get_string(oo, "window-status-current-format");
}
- if (session_alert_has(s, wl, WINDOW_ACTIVITY) ||
- session_alert_has(s, wl, WINDOW_BELL) ||
- session_alert_has(s, wl, WINDOW_CONTENT)) {
+ if (wl->flags & WINLINK_ALERTFLAGS) {
fg = options_get_number(oo, "window-status-alert-fg");
if (fg != 8)
colour_set_fg(gc, fg);