diff --git a/src/contour/helper.cpp b/src/contour/helper.cpp index d389ef42c0..c365854489 100644 --- a/src/contour/helper.cpp +++ b/src/contour/helper.cpp @@ -183,16 +183,34 @@ void sendWheelEvent(QWheelEvent* _event, TerminalSession& _session) { auto const yDelta = [&]() -> int { -// switch (_event->orientation()) -// { -// case Qt::Orientation::Horizontal: -// return _event->pixelDelta().x() ? _event->pixelDelta().x() -// : _event->angleDelta().x(); -// case Qt::Orientation::Vertical: -// return _event->pixelDelta().y() ? _event->pixelDelta().y() -// : _event->angleDelta().y(); -// } + #if 1 // FIXME: Temporarily addressing a really bad Qt implementation detail + // as tracked here: + // https://github.com/contour-terminal/contour/issues/394 + + if (_event->pixelDelta().y()) + return _event->pixelDelta().y(); + if (_event->angleDelta().y()) + return _event->angleDelta().y(); + + if (_event->pixelDelta().x()) + return _event->pixelDelta().x(); + if (_event->angleDelta().x()) + return _event->angleDelta().x(); + + return 0; + + #else + // switch (_event->orientation()) + // { + // case Qt::Orientation::Horizontal: + // return _event->pixelDelta().x() ? _event->pixelDelta().x() + // : _event->angleDelta().x(); + // case Qt::Orientation::Vertical: + // return _event->pixelDelta().y() ? _event->pixelDelta().y() + // : _event->angleDelta().y(); + // } return _event->angleDelta().y(); + #endif }(); if (yDelta)