Skip to content

Commit

Permalink
Revert "fixed horizontal scrolling issue"
Browse files Browse the repository at this point in the history
This reverts commit b4555c1.
  • Loading branch information
lbwtw authored and zccrs committed Nov 6, 2024
1 parent 6e88ca5 commit 7101408
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/server/kernel/wseat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1083,17 +1083,11 @@ void WSeat::notifyAxis(WCursor *cursor, WInputDevice *device, wlr_axis_source_t
const QPointF &global = cursor->position();
const QPointF local = w ? global - QPointF(w->position()) : QPointF();

QPoint angleDelta, pixelDelta;
if (Qt::Horizontal == orientation) {
angleDelta = QPoint(-delta, 0);
pixelDelta = QPoint(-delta_discrete, 0);
} else {
angleDelta = QPoint(0, -delta);
pixelDelta = QPoint(0, -delta_discrete);
}

WSeatWheelEvent e(source, delta, local, global, pixelDelta, angleDelta, Qt::NoButton, d->keyModifiers,
Qt::NoScrollPhase, false, Qt::MouseEventNotSynthesized, qwDevice);
// Refer to https://github.com/qt/qtwayland/blob/774c0be247bd04362fc7713919ac151c44e34ced/src/client/qwaylandinputdevice.cpp#L1089
// The direction in Qt event is in the opposite direction of wayland one, generate a event identical to Qt's direction.
QPoint angleDelta = orientation == Qt::Horizontal ? QPoint(-delta_discrete, 0) : QPoint(0, -delta_discrete);
WSeatWheelEvent e(source, delta, local, global, QPoint(), angleDelta, Qt::NoButton, d->keyModifiers,
Qt::NoScrollPhase, false, Qt::MouseEventNotSynthesized, qwDevice);
e.setTimestamp(timestamp);

if (w) {
Expand Down

0 comments on commit 7101408

Please sign in to comment.