aboutsummaryrefslogtreecommitdiff
path: root/resize.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-07-15 17:42:44 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-07-15 17:42:44 +0000
commit1e574bb70c2770fe5886fd7327966dfc543e3939 (patch)
tree21daf5e0c06f69035a1b2c43fe2a9d12e41c868f /resize.c
parent537c32b6b61d93b3489fee9cea26cd808125e265 (diff)
downloadrtmux-1e574bb70c2770fe5886fd7327966dfc543e3939.tar.gz
rtmux-1e574bb70c2770fe5886fd7327966dfc543e3939.tar.bz2
rtmux-1e574bb70c2770fe5886fd7327966dfc543e3939.zip
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.
Diffstat (limited to 'resize.c')
-rw-r--r--resize.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/resize.c b/resize.c
index e6c73222..b8f7b0d3 100644
--- a/resize.c
+++ b/resize.c
@@ -1,4 +1,4 @@
-/* $Id: resize.c,v 1.21 2009-04-01 21:10:08 nicm Exp $ */
+/* $Id: resize.c,v 1.22 2009-07-15 17:42:44 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -48,6 +48,7 @@ recalculate_sizes(void)
struct session *s;
struct client *c;
struct window *w;
+ struct window_pane *wp;
u_int i, j, ssx, ssy, has, limit;
int flag;
@@ -132,6 +133,20 @@ recalculate_sizes(void)
"window size %u,%u (was %u,%u)", ssx, ssy, w->sx, w->sy);
window_resize(w, ssx, ssy);
+
+ /*
+ * If the current pane is now not visible, move to the next
+ * that is.
+ */
+ wp = w->active;
+ 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)
+ break;
+ }
+
server_redraw_window(w);
layout_refresh(w, 0);
}