mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Fix mouse positioning when the pane is not entirely visible.
This commit is contained in:
		@@ -148,7 +148,7 @@ cmd_resize_pane_mouse_update(struct client *c, struct mouse_event *m)
 | 
			
		||||
		y--;
 | 
			
		||||
	else if (m->statusat > 0 && y >= (u_int)m->statusat)
 | 
			
		||||
		y = m->statusat - 1;
 | 
			
		||||
	ly = m->ly; lx = m->lx;
 | 
			
		||||
	ly = m->ly + m->oy; lx = m->lx + m->ox;
 | 
			
		||||
	if (m->statusat == 0 && ly > 0)
 | 
			
		||||
		ly--;
 | 
			
		||||
	else if (m->statusat > 0 && ly >= (u_int)m->statusat)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										7
									
								
								cmd.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								cmd.c
									
									
									
									
									
								
							@@ -481,17 +481,16 @@ cmd_mouse_at(struct window_pane *wp, struct mouse_event *m, u_int *xp,
 | 
			
		||||
	u_int	x, y;
 | 
			
		||||
 | 
			
		||||
	if (last) {
 | 
			
		||||
		x = m->lx;
 | 
			
		||||
		y = m->ly;
 | 
			
		||||
		x = m->lx + m->ox;
 | 
			
		||||
		y = m->ly + m->oy;
 | 
			
		||||
	} else {
 | 
			
		||||
		x = m->x;
 | 
			
		||||
		y = m->y;
 | 
			
		||||
	}
 | 
			
		||||
	log_debug("%s: x=%u, y=%u%s", __func__, x, y, last ? " (last)" : "");
 | 
			
		||||
 | 
			
		||||
	if (m->statusat == 0 && y > 0)
 | 
			
		||||
		y--;
 | 
			
		||||
	else if (m->statusat > 0 && y >= (u_int)m->statusat)
 | 
			
		||||
		y = m->statusat - 1;
 | 
			
		||||
 | 
			
		||||
	if (x < wp->xoff || x >= wp->xoff + wp->sx)
 | 
			
		||||
		return (-1);
 | 
			
		||||
 
 | 
			
		||||
@@ -450,7 +450,7 @@ server_client_check_mouse(struct client *c, struct key_event *event)
 | 
			
		||||
			x = m->x, y = m->y, b = m->b;
 | 
			
		||||
			log_debug("drag update at %u,%u", x, y);
 | 
			
		||||
		} else {
 | 
			
		||||
			x = m->lx - m->ox, y = m->ly - m->oy, b = m->lb;
 | 
			
		||||
			x = m->lx, y = m->ly, b = m->lb;
 | 
			
		||||
			log_debug("drag start at %u,%u", x, y);
 | 
			
		||||
		}
 | 
			
		||||
	} else if (MOUSE_WHEEL(m->b)) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user