diff --git a/cursor.cpp b/cursor.cpp index 880f46b9cb..db68ce7fef 100644 --- a/cursor.cpp +++ b/cursor.cpp @@ -511,7 +511,6 @@ QByteArray Cursor::cursorName(Qt::CursorShape shape) const InputRedirectionCursor::InputRedirectionCursor(QObject *parent) : Cursor(parent) - , m_oldButtons(Qt::NoButton) , m_currentButtons(Qt::NoButton) { connect(input(), SIGNAL(globalPointerChanged(QPointF)), SLOT(slotPosChanged(QPointF))); @@ -547,7 +546,7 @@ void InputRedirectionCursor::slotPosChanged(const QPointF &pos) { const QPoint oldPos = currentPos(); updatePos(pos.toPoint()); - emit mouseChanged(pos.toPoint(), oldPos, m_currentButtons, m_oldButtons, + emit mouseChanged(pos.toPoint(), oldPos, m_currentButtons, m_currentButtons, input()->keyboardModifiers(), input()->keyboardModifiers()); } @@ -558,8 +557,10 @@ void InputRedirectionCursor::slotModifiersChanged(Qt::KeyboardModifiers mods, Qt void InputRedirectionCursor::slotPointerButtonChanged() { - m_oldButtons = m_currentButtons; + const Qt::MouseButtons oldButtons = m_currentButtons; m_currentButtons = input()->qtButtonStates(); + const QPoint pos = currentPos(); + emit mouseChanged(pos, pos, m_currentButtons, oldButtons, input()->keyboardModifiers(), input()->keyboardModifiers()); } void InputRedirectionCursor::doStartCursorTracking() diff --git a/cursor.h b/cursor.h index 067afc8ef4..d37a0aabcb 100644 --- a/cursor.h +++ b/cursor.h @@ -271,7 +271,6 @@ private Q_SLOTS: void slotModifiersChanged(Qt::KeyboardModifiers mods, Qt::KeyboardModifiers oldMods); private: explicit InputRedirectionCursor(QObject *parent); - Qt::MouseButtons m_oldButtons; Qt::MouseButtons m_currentButtons; friend class Cursor; };