mirror of
https://github.com/tmux/tmux.git
synced 2025-04-22 04:18:47 +00:00
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@.
This commit is contained in:
parent
e4e728664b
commit
503edae26f
4
window.c
4
window.c
@ -325,6 +325,8 @@ window_resize(struct window *w, u_int sx, u_int sy)
|
|||||||
void
|
void
|
||||||
window_set_active_pane(struct window *w, struct window_pane *wp)
|
window_set_active_pane(struct window *w, struct window_pane *wp)
|
||||||
{
|
{
|
||||||
|
if (wp == w->active)
|
||||||
|
return;
|
||||||
w->last = w->active;
|
w->last = w->active;
|
||||||
w->active = wp;
|
w->active = wp;
|
||||||
while (!window_pane_visible(w->active)) {
|
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;
|
struct window_pane *wp;
|
||||||
|
|
||||||
TAILQ_FOREACH(wp, &w->panes, entry) {
|
TAILQ_FOREACH(wp, &w->panes, entry) {
|
||||||
if (!window_pane_visible(wp))
|
if (wp == w->active || !window_pane_visible(wp))
|
||||||
continue;
|
continue;
|
||||||
if (x < wp->xoff || x >= wp->xoff + wp->sx)
|
if (x < wp->xoff || x >= wp->xoff + wp->sx)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user