mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	Assign mouse x/y coords before checking them. When receiving mouse
inputs, we should set the x/y coordinates earlier than we currently do, so that we aren't off-by-one in the case when the statusbar is at the top of the screen. By Thomas Adam.
This commit is contained in:
		@@ -746,6 +746,8 @@ tty_keys_mouse(struct tty *tty, const char *buf, size_t len, size_t *size)
 | 
				
			|||||||
	m->sgr = sgr;
 | 
						m->sgr = sgr;
 | 
				
			||||||
	m->sgr_xb = sgr_b;
 | 
						m->sgr_xb = sgr_b;
 | 
				
			||||||
	m->sgr_rel = sgr_rel;
 | 
						m->sgr_rel = sgr_rel;
 | 
				
			||||||
 | 
						m->x = x;
 | 
				
			||||||
 | 
						m->y = y;
 | 
				
			||||||
	if (b & 64) { /* wheel button */
 | 
						if (b & 64) { /* wheel button */
 | 
				
			||||||
		b &= 3;
 | 
							b &= 3;
 | 
				
			||||||
		if (b == 0)
 | 
							if (b == 0)
 | 
				
			||||||
@@ -773,8 +775,6 @@ tty_keys_mouse(struct tty *tty, const char *buf, size_t len, size_t *size)
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		m->button = (b & 3);
 | 
							m->button = (b & 3);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	m->x = x;
 | 
					 | 
				
			||||||
	m->y = y;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return (0);
 | 
						return (0);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user