Get rid of the PANE_HIDDEN flag in favour of a function, and moving the

decision for whether or not a pane should be drawn out of the layout code and
into the redraw code.

This is needed for the new layout design, getting it in now to make that easier
to work on.
This commit is contained in:
Nicholas Marriott
2009-07-14 07:23:36 +00:00
parent 4a9b01eb0d
commit fe20c0d89e
12 changed files with 92 additions and 91 deletions

View File

@ -291,8 +291,14 @@ void
window_set_active_pane(struct window *w, struct window_pane *wp)
{
w->active = wp;
while (w->active->flags & PANE_HIDDEN)
while (!window_pane_visible(w->active)) {
w->active = TAILQ_PREV(w->active, window_panes, entry);
if (w->active == NULL)
w->active = TAILQ_LAST(&w->panes, window_panes);
if (w->active == wp)
return;
}
}
struct window_pane *
@ -607,6 +613,18 @@ window_pane_mouse(
input_mouse(wp, b, x, y);
}
int
window_pane_visible(struct window_pane *wp)
{
struct window *w = wp->window;
if (wp->xoff >= w->sx || wp->yoff >= w->sy)
return (0);
if (wp->xoff + wp->sx > w->sx || wp->yoff + wp->sy > w->sy)
return (0);
return (1);
}
char *
window_pane_search(struct window_pane *wp, const char *searchstr, u_int *lineno)
{