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
6667d96ed9, 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.
wilder
Luis Javier Merino Morán 5 years ago committed by Tomaz Canabrava
parent 66e19aaf41
commit c9f77e5276
  1. 7
      src/terminalDisplay/TerminalDisplay.cpp

@ -1244,7 +1244,12 @@ void TerminalDisplay::mouseMoveEvent(QMouseEvent* ev)
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;
}

Loading…
Cancel
Save