Support AutoScroll while mouse tracking is enabled

AutoScrollHandler generates synthetic mouse moves to allow extending the
selection by dragging the mouse ouside the display area.  The synthetic
events it generates didn't carry any modifiers, so they were not
properly working when an application had requested mouse tracking
reports.  In that case, generate the events with ShiftModifier, so they
work properly.
wilder
Luis Javier Merino Morán 5 years ago committed by Tomaz Canabrava
parent 6aa4056304
commit a66d2e235d
  1. 3
      src/terminalDisplay/extras/AutoScrollHandler.cpp

@ -25,11 +25,12 @@ void AutoScrollHandler::timerEvent(QTimerEvent* event)
return;
}
auto* terminalDisplay = static_cast<TerminalDisplay*>(parent());
QMouseEvent mouseEvent(QEvent::MouseMove,
widget()->mapFromGlobal(QCursor::pos()),
Qt::NoButton,
Qt::LeftButton,
Qt::NoModifier);
terminalDisplay->usesMouseTracking() ? Qt::ShiftModifier : Qt::NoModifier);
QApplication::sendEvent(widget(), &mouseEvent);
}

Loading…
Cancel
Save