version 1.173, 2016/10/18 07:38:16 |
version 1.174, 2016/10/19 09:22:07 |
|
|
static u_int next_window_id; |
static u_int next_window_id; |
static u_int next_active_point; |
static u_int next_active_point; |
|
|
|
static void window_destroy(struct window *); |
|
|
static struct window_pane *window_pane_create(struct window *, u_int, u_int, |
static struct window_pane *window_pane_create(struct window *, u_int, u_int, |
u_int); |
u_int); |
static void window_pane_destroy(struct window_pane *); |
static void window_pane_destroy(struct window_pane *); |
|
|
void |
void |
winlink_set_window(struct winlink *wl, struct window *w) |
winlink_set_window(struct winlink *wl, struct window *w) |
{ |
{ |
|
if (wl->window != NULL) { |
|
TAILQ_REMOVE(&wl->window->winlinks, wl, wentry); |
|
window_remove_ref(w); |
|
} |
|
TAILQ_INSERT_TAIL(&w->winlinks, wl, wentry); |
wl->window = w; |
wl->window = w; |
w->references++; |
w->references++; |
} |
} |
|
|
{ |
{ |
struct window *w = wl->window; |
struct window *w = wl->window; |
|
|
|
if (w != NULL) { |
|
TAILQ_REMOVE(&w->winlinks, wl, wentry); |
|
window_remove_ref(w); |
|
} |
|
|
RB_REMOVE(winlinks, wwl, wl); |
RB_REMOVE(winlinks, wwl, wl); |
free(wl->status_text); |
free(wl->status_text); |
free(wl); |
free(wl); |
|
|
if (w != NULL) |
|
window_remove_ref(w); |
|
} |
} |
|
|
struct winlink * |
struct winlink * |
|
|
w->options = options_create(global_w_options); |
w->options = options_create(global_w_options); |
|
|
w->references = 0; |
w->references = 0; |
|
TAILQ_INIT(&w->winlinks); |
|
|
w->id = next_window_id++; |
w->id = next_window_id++; |
RB_INSERT(windows, &windows, w); |
RB_INSERT(windows, &windows, w); |
|
|
return (w); |
return (w); |
} |
} |
|
|
void |
static void |
window_destroy(struct window *w) |
window_destroy(struct window *w) |
{ |
{ |
|
if (!TAILQ_EMPTY(&w->winlinks)) |
|
fatalx("window destroyed with winlinks"); |
|
|
RB_REMOVE(windows, &windows, w); |
RB_REMOVE(windows, &windows, w); |
|
|
if (w->layout_root != NULL) |
if (w->layout_root != NULL) |
|
|
void |
void |
winlink_clear_flags(struct winlink *wl) |
winlink_clear_flags(struct winlink *wl) |
{ |
{ |
struct session *s; |
struct winlink *loop; |
struct winlink *wl_loop; |
|
|
|
RB_FOREACH(s, sessions, &sessions) { |
wl->window->flags &= ~WINDOW_ALERTFLAGS; |
RB_FOREACH(wl_loop, winlinks, &s->windows) { |
TAILQ_FOREACH(loop, &wl->window->winlinks, wentry) { |
if (wl_loop->window != wl->window) |
if ((loop->flags & WINLINK_ALERTFLAGS) != 0) { |
continue; |
loop->flags &= ~WINLINK_ALERTFLAGS; |
if ((wl_loop->flags & WINLINK_ALERTFLAGS) == 0) |
server_status_session(loop->session); |
continue; |
|
|
|
wl_loop->flags &= ~WINLINK_ALERTFLAGS; |
|
wl_loop->window->flags &= ~WINDOW_ALERTFLAGS; |
|
server_status_session(s); |
|
} |
} |
} |
} |
} |
} |