diff --git a/src/backends/x11/standalone/effects_mouse_interception_x11_filter.cpp b/src/backends/x11/standalone/effects_mouse_interception_x11_filter.cpp index e9699517a3..b163dfdd9f 100644 --- a/src/backends/x11/standalone/effects_mouse_interception_x11_filter.cpp +++ b/src/backends/x11/standalone/effects_mouse_interception_x11_filter.cpp @@ -62,13 +62,8 @@ bool EffectsMouseInterceptionX11Filter::event(xcb_generic_event_t *event) // angleDelta = angleDelta.transposed(); } - if (angleDelta.y()) { - QWheelEvent ev(QPoint(me->event_x, me->event_y), angleDelta.y(), buttons, modifiers, Qt::Vertical); - return m_effects->checkInputWindowEvent(&ev); - } else if (angleDelta.x()) { - QWheelEvent ev(QPoint(me->event_x, me->event_y), angleDelta.x(), buttons, modifiers, Qt::Horizontal); - return m_effects->checkInputWindowEvent(&ev); - } + QWheelEvent ev(QPoint(me->event_x, me->event_y), QCursor::pos(), QPoint(), angleDelta, buttons, modifiers, Qt::NoScrollPhase, false); + return m_effects->checkInputWindowEvent(&ev); } const Qt::MouseButton button = x11ToQtMouseButton(me->detail); Qt::MouseButtons buttons = x11ToQtMouseButtons(me->state); diff --git a/src/events.cpp b/src/events.cpp index 11bdd4a5e8..f5e0439b66 100644 --- a/src/events.cpp +++ b/src/events.cpp @@ -939,10 +939,10 @@ bool X11Client::buttonPressEvent(xcb_window_t w, int button, int state, int x, i QPointF(x_root, y_root), QPoint(), angle, - delta, - hor ? Qt::Horizontal : Qt::Vertical, x11ToQtMouseButtons(state), - modifiers); + modifiers, + Qt::NoScrollPhase, + false); event.setAccepted(false); QCoreApplication::sendEvent(decoration(), &event); if (!event.isAccepted() && !hor) { diff --git a/src/input.cpp b/src/input.cpp index f9dd6d69c1..12793f87b6 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1057,12 +1057,12 @@ class InternalWindowEventFilter : public InputEventFilter { const QPointF localPos = event->globalPosition() - internal->position(); const Qt::Orientation orientation = (event->angleDelta().x() != 0) ? Qt::Horizontal : Qt::Vertical; const int delta = event->angleDelta().x() != 0 ? event->angleDelta().x() : event->angleDelta().y(); - QWheelEvent wheelEvent(localPos, event->globalPosF(), QPoint(), + QWheelEvent wheelEvent(localPos, event->globalPosition(), QPoint(), event->angleDelta() * -1, - delta * -1, - orientation, event->buttons(), - event->modifiers()); + event->modifiers(), + Qt::NoScrollPhase, + false); QCoreApplication::sendEvent(internal, &wheelEvent); return wheelEvent.isAccepted(); } @@ -1255,10 +1255,10 @@ public: const int delta = event->angleDelta().x() != 0 ? event->angleDelta().x() : event->angleDelta().y(); QWheelEvent e(localPos, event->globalPosition(), QPoint(), event->angleDelta(), - delta, - orientation, event->buttons(), - event->modifiers()); + event->modifiers(), + Qt::NoScrollPhase, + false); e.setAccepted(false); QCoreApplication::sendEvent(decoration, &e); if (e.isAccepted()) { diff --git a/src/input_event.cpp b/src/input_event.cpp index b6d023adfb..665a02310b 100644 --- a/src/input_event.cpp +++ b/src/input_event.cpp @@ -27,7 +27,7 @@ MouseEvent::MouseEvent(QEvent::Type type, const QPointF &pos, Qt::MouseButton bu WheelEvent::WheelEvent(const QPointF &pos, qreal delta, qint32 discreteDelta, Qt::Orientation orientation, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, InputRedirection::PointerAxisSource source, quint32 timestamp, InputDevice *device) - : QWheelEvent(pos, pos, QPoint(), (orientation == Qt::Horizontal) ? QPoint(delta, 0) : QPoint(0, delta), delta, orientation, buttons, modifiers) + : QWheelEvent(pos, pos, QPoint(), (orientation == Qt::Horizontal) ? QPoint(delta, 0) : QPoint(0, delta), buttons, modifiers, Qt::NoScrollPhase, false) , m_device(device) , m_orientation(orientation) , m_delta(delta)