Skip to content

Commit

Permalink
xcb: add qt.qpa.input.events logging of wheel events
Browse files Browse the repository at this point in the history
This is comparable to what we do on macOS, except that the scroll phase
and inverted state are missing.

Task-number: QTBUG-38570
Task-number: QTBUG-56075
Change-Id: I27502e1e2667317ab701f30f1fc601ae1e0591d0
Reviewed-by: Gatis Paeglis <[email protected]>
  • Loading branch information
ec1oud committed Jun 21, 2018
1 parent be0a6ab commit af837f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,7 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
std::swap(angleDelta.rx(), angleDelta.ry());
std::swap(rawDelta.rx(), rawDelta.ry());
}
qCDebug(lcQpaXInputEvents) << "scroll wheel @ window pos" << local << "delta px" << rawDelta << "angle" << angleDelta;
QWindowSystemInterface::handleWheelEvent(platformWindow->window(), xiEvent->time, local, global, rawDelta, angleDelta, modifiers);
}
}
Expand All @@ -1065,6 +1066,7 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
Qt::KeyboardModifiers modifiers = keyboard()->translateModifiers(xiDeviceEvent->mods.effective_mods);
if (modifiers & Qt::AltModifier)
std::swap(angleDelta.rx(), angleDelta.ry());
qCDebug(lcQpaXInputEvents) << "scroll wheel (button" << xiDeviceEvent->detail << ") @ window pos" << local << "delta angle" << angleDelta;
QWindowSystemInterface::handleWheelEvent(platformWindow->window(), xiEvent->time, local, global, QPoint(), angleDelta, modifiers);
}
}
Expand Down

0 comments on commit af837f9

Please sign in to comment.