mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		
							
								
								
									
										26
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								window.c
									
									
									
									
									
								
							@@ -434,14 +434,21 @@ window_resize(struct window *w, u_int sx, u_int sy, int xpixel, int ypixel)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
window_pane_send_resize(struct window_pane *wp, int yadjust)
 | 
			
		||||
window_pane_send_resize(struct window_pane *wp, int force)
 | 
			
		||||
{
 | 
			
		||||
	struct window	*w = wp->window;
 | 
			
		||||
	struct winsize	 ws;
 | 
			
		||||
	u_int  		 sy = wp->sy + yadjust;
 | 
			
		||||
	u_int  		 sy;
 | 
			
		||||
 | 
			
		||||
	if (wp->fd == -1)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (!force)
 | 
			
		||||
		sy = wp->sy;
 | 
			
		||||
	else if (wp->sy <= 1)
 | 
			
		||||
		sy = wp->sy + 1;
 | 
			
		||||
	else
 | 
			
		||||
		sy = wp->sy - 1;
 | 
			
		||||
	log_debug("%s: %%%u resize to %u,%u", __func__, wp->id, wp->sx, sy);
 | 
			
		||||
 | 
			
		||||
	memset(&ws, 0, sizeof ws);
 | 
			
		||||
@@ -884,8 +891,8 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
 | 
			
		||||
	wp->xoff = 0;
 | 
			
		||||
	wp->yoff = 0;
 | 
			
		||||
 | 
			
		||||
	wp->sx = wp->osx = sx;
 | 
			
		||||
	wp->sy = wp->osx = sy;
 | 
			
		||||
	wp->sx = sx;
 | 
			
		||||
	wp->sy = sy;
 | 
			
		||||
 | 
			
		||||
	wp->pipe_fd = -1;
 | 
			
		||||
	wp->pipe_event = NULL;
 | 
			
		||||
@@ -928,6 +935,8 @@ window_pane_destroy(struct window_pane *wp)
 | 
			
		||||
 | 
			
		||||
	if (event_initialized(&wp->resize_timer))
 | 
			
		||||
		event_del(&wp->resize_timer);
 | 
			
		||||
	if (event_initialized(&wp->force_timer))
 | 
			
		||||
		event_del(&wp->force_timer);
 | 
			
		||||
 | 
			
		||||
	RB_REMOVE(window_pane_tree, &all_window_panes, wp);
 | 
			
		||||
 | 
			
		||||
@@ -1008,7 +1017,14 @@ window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
 | 
			
		||||
	wme = TAILQ_FIRST(&wp->modes);
 | 
			
		||||
	if (wme != NULL && wme->mode->resize != NULL)
 | 
			
		||||
		wme->mode->resize(wme, sx, sy);
 | 
			
		||||
	wp->flags |= (PANE_RESIZE|PANE_RESIZED);
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * If the pane has already been resized, set the force flag and make
 | 
			
		||||
	 * the application resize twice to force it to redraw.
 | 
			
		||||
	 */
 | 
			
		||||
	if (wp->flags & PANE_RESIZE)
 | 
			
		||||
		wp->flags |= PANE_RESIZEFORCE;
 | 
			
		||||
	wp->flags |= PANE_RESIZE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user