Commit c9f77e52 authored by Luis Javier Merino's avatar Luis Javier Merino Committed by Tomaz Canabrava
Browse files

Restore AutoScrollHandler behavior

AutoScrollHandler allows to extend the selection by dragging the mouse
outside the display.  It does this by generating synthetic mouse move
events when the left mouse button is held down and the mouse is moved
outside of the display area.  This improves the user experience of
extending the selection to cover text that is scrolled outside the
display area.

Unfortunately, this was broken by commit
6667d96e, which filters out mouse move
events if they don't change the character cell position.  So, modify the
filtering a bit, allowing mouse movements outside the display area to
pass through.
parent 66e19aaf
...@@ -1244,7 +1244,12 @@ void TerminalDisplay::mouseMoveEvent(QMouseEvent* ev) ...@@ -1244,7 +1244,12 @@ void TerminalDisplay::mouseMoveEvent(QMouseEvent* ev)
auto [charLine, charColumn] = getCharacterPosition(ev->pos(), !_usesMouseTracking); auto [charLine, charColumn] = getCharacterPosition(ev->pos(), !_usesMouseTracking);
if (charLine == _prevCharacterLine && charColumn == _prevCharacterColumn) { // Ignore mouse movements that don't change the character position,
// but don't ignore the ones generated by AutoScrollHandler (which
// allow to extend the selection by dragging the mouse outside the
// display).
if (charLine == _prevCharacterLine && charColumn == _prevCharacterColumn &&
contentsRect().contains(ev->pos())) {
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment