diff options
author | Tiago Cunha <tcunha@gmx.com> | 2010-10-24 01:32:35 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2010-10-24 01:32:35 +0000 |
commit | 8703e9f2f90e52ca69b7126f1aa03b48f86a67f6 (patch) | |
tree | 860472b2a1fb3b8ac1409de102b62b534173738f | |
parent | 2da0730f78ba3f96eba98584d08fba1a98a1ca60 (diff) |
Sync OpenBSD patchset 779:
When removing a pane, don't change the active pane unless the active
pane is actually the one being removed.
-rw-r--r-- | window.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.138 2010-10-24 00:45:57 tcunha Exp $ */ +/* $Id: window.c,v 1.139 2010-10-24 01:32:35 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -365,9 +365,11 @@ window_add_pane(struct window *w, u_int hlimit) void window_remove_pane(struct window *w, struct window_pane *wp) { - w->active = TAILQ_PREV(wp, window_panes, entry); - if (w->active == NULL) - w->active = TAILQ_NEXT(wp, entry); + if (wp == w->active) { + w->active = TAILQ_PREV(wp, window_panes, entry); + if (w->active == NULL) + w->active = TAILQ_NEXT(wp, entry); + } TAILQ_REMOVE(&w->panes, wp, entry); window_pane_destroy(wp); |