mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
term_mouse: make special treatment of x < 0 more selective.
A mouse drag which manages to reach x < 0 (via SetCapture or equivalent) was treated as having the coordinates of (x_max, y-1). This is intended to be useful when the mouse drag is part of ordinary raster-ordered selection. But we were leaving that treatment enabled even for mouse actions that went to xterm mouse tracking mode - thanks to Markus Gans for reporting that - and when I investigated, I realised that this isn't a sensible transformation in _rectangular_ selection mode either. Fixed both.
This commit is contained in:
parent
f813e9f937
commit
6b824713d5
13
terminal.c
13
terminal.c
@ -6088,7 +6088,18 @@ void term_mouse(Terminal *term, Mouse_Button braw, Mouse_Button bcooked,
|
||||
term_scroll(term, 0, +1);
|
||||
}
|
||||
if (x < 0) {
|
||||
if (y > 0) {
|
||||
if (y > 0 && !raw_mouse && term->seltype != RECTANGULAR) {
|
||||
/*
|
||||
* When we're using the mouse for normal raster-based
|
||||
* selection, dragging off the left edge of a terminal row
|
||||
* is treated the same as the right-hand end of the
|
||||
* previous row, in that it's considered to identify a
|
||||
* point _before_ the first character on row y.
|
||||
*
|
||||
* But if the mouse action is going to be used for
|
||||
* anything else - rectangular selection, or xterm mouse
|
||||
* tracking - then we disable this special treatment.
|
||||
*/
|
||||
x = term->cols - 1;
|
||||
y--;
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user