diff options
Diffstat (limited to 'server-window.c')
-rw-r--r-- | server-window.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/server-window.c b/server-window.c index a2355701..f157da35 100644 --- a/server-window.c +++ b/server-window.c @@ -34,24 +34,20 @@ void server_window_loop(void) { struct window *w; - struct winlink *wl; struct session *s; - u_int i; - - for (i = 0; i < ARRAY_LENGTH(&windows); i++) { - w = ARRAY_ITEM(&windows, i); - if (w == NULL) - continue; + struct winlink *wl; + RB_FOREACH(w, windows, &windows) { RB_FOREACH(s, sessions, &sessions) { - wl = session_has(s, w); - if (wl == NULL) - continue; - - if (server_window_check_bell(s, wl) || - server_window_check_activity(s, wl) || - server_window_check_silence(s, wl)) - server_status_session(s); + RB_FOREACH(wl, winlinks, &s->windows) { + if (wl->window != w) + continue; + + if (server_window_check_bell(s, wl) || + server_window_check_activity(s, wl) || + server_window_check_silence(s, wl)) + server_status_session(s); + } } } } |