Skip to content

Commit

Permalink
Temporary work-around for #394 (mouse wheel issue with Alt-modifier).
Browse files Browse the repository at this point in the history
  • Loading branch information
christianparpart committed Aug 16, 2021
1 parent 8580136 commit 334a08d
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions src/contour/helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 334a08d

Please sign in to comment.