aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-11-14 08:58:25 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-11-14 08:58:25 +0000
commit503edae26fff7a6e6bb8b76f2ea009b2ed99ced1 (patch)
treeb381a0013843c77c8d08a6d6a3075a82d3788cab /window.c
parente4e728664b1a02b6c259131f9c34cbd0d30252a7 (diff)
downloadrtmux-503edae26fff7a6e6bb8b76f2ea009b2ed99ced1.tar.gz
rtmux-503edae26fff7a6e6bb8b76f2ea009b2ed99ced1.tar.bz2
rtmux-503edae26fff7a6e6bb8b76f2ea009b2ed99ced1.zip
Don't allow last and active window to become the same - a very bad move
when the active window is closed and freed. Reported by sthen@.
Diffstat (limited to 'window.c')
-rw-r--r--window.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/window.c b/window.c
index 7087e324..a7a5c40e 100644
--- a/window.c
+++ b/window.c
@@ -325,6 +325,8 @@ window_resize(struct window *w, u_int sx, u_int sy)
void
window_set_active_pane(struct window *w, struct window_pane *wp)
{
+ if (wp == w->active)
+ return;
w->last = w->active;
w->active = wp;
while (!window_pane_visible(w->active)) {
@@ -342,7 +344,7 @@ window_set_active_at(struct window *w, u_int x, u_int y)
struct window_pane *wp;
TAILQ_FOREACH(wp, &w->panes, entry) {
- if (!window_pane_visible(wp))
+ if (wp == w->active || !window_pane_visible(wp))
continue;
if (x < wp->xoff || x >= wp->xoff + wp->sx)
continue;