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

Restrict mouse movement to cells only for mousetracking.

After 6667d96e broke scrolling, and apparently neither c9f77e52 nor MR
!413 where able to totally fix it for all use cases, applying the
restriction to cells only when sending mouse tracking events should fix
all remaining warts.
parent ec64ccd3
Pipeline #179893 passed with stage
in 2 minutes and 12 seconds
......@@ -1271,17 +1271,6 @@ void TerminalDisplay::mouseMoveEvent(QMouseEvent *ev)
auto [charLine, charColumn] = getCharacterPosition(ev->pos(), !usesMouseTracking());
// 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())) {
_prevCharacterLine = charLine;
_prevCharacterColumn = charColumn;
_filterChain->mouseMoveEvent(this, ev, charLine, charColumn);
......@@ -1290,6 +1279,14 @@ void TerminalDisplay::mouseMoveEvent(QMouseEvent *ev)
// events then emit a mouse movement signal, unless the shift key is
// being held down, which overrides this.
if (usesMouseTracking() && !(ev->modifiers() & Qt::ShiftModifier)) {
// Ignore mouse movements that don't change the character position.
if (charLine == _prevCharacterLine && charColumn == _prevCharacterColumn) {
_prevCharacterLine = charLine;
_prevCharacterColumn = charColumn;
if (!_readOnly) {
int button = 3;
if ((ev->buttons() & Qt::LeftButton) != 0u) {
Supports Markdown
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