aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2010-12-06 21:53:50 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2010-12-06 21:53:50 +0000
commit36e537bcef59cdf194cacf3584b748d49554b32a (patch)
tree19734720c2bfe9694fbff2cb7a2e898b3fcf8885
parentfd51bf61c9ff59fc455d45eb1ca6c07afaae3a0e (diff)
downloadrtmux-36e537bcef59cdf194cacf3584b748d49554b32a.tar.gz
rtmux-36e537bcef59cdf194cacf3584b748d49554b32a.tar.bz2
rtmux-36e537bcef59cdf194cacf3584b748d49554b32a.zip
PatchSet 786
Date: 2010/11/14 08:58:25 Author: nicm Branch: HEAD Tag: (none) Log: 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@. Members: window.c:1.58->1.59
-rw-r--r--window.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/window.c b/window.c
index 1c9160bc..f81acc4f 100644
--- a/window.c
+++ b/window.c
@@ -1,4 +1,4 @@
-/* $Id: window.c,v 1.140 2010-10-24 01:34:30 tcunha Exp $ */
+/* $Id: window.c,v 1.141 2010-12-06 21:53:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -322,6 +322,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)) {
@@ -339,7 +341,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;