Change the windows array into an RB tree and fix some places where we

were only looking at the first winlink for a window in a session.
This commit is contained in:
nicm
2015-04-22 15:30:11 +00:00
parent 89e80cabd5
commit 8d66f4fba4
7 changed files with 50 additions and 90 deletions

View File

@ -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;
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);
if (server_window_check_bell(s, wl) ||
server_window_check_activity(s, wl) ||
server_window_check_silence(s, wl))
server_status_session(s);
}
}
}
}