mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:44:18 +00:00 
			
		
		
		
	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
			
			
This commit is contained in:
		
							
								
								
									
										6
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user