Correctly detect mouseChanged between polls.
REVIEW: 112392 BUG: 323979 FIXED-IN: 4.11.2
This commit is contained in:
parent
29e230dca3
commit
f62162eb41
1 changed files with 6 additions and 4 deletions
10
cursor.cpp
10
cursor.cpp
|
@ -227,13 +227,15 @@ void X11Cursor::doStopCursorTracking()
|
||||||
|
|
||||||
void X11Cursor::mousePolled()
|
void X11Cursor::mousePolled()
|
||||||
{
|
{
|
||||||
const QPoint last = currentPos();
|
static QPoint lastPos = currentPos();
|
||||||
const uint16_t lastMask = m_buttonMask;
|
static uint16_t lastMask = m_buttonMask;
|
||||||
doGetPos(); // Update if needed
|
doGetPos(); // Update if needed
|
||||||
if (last != currentPos() || lastMask != m_buttonMask) {
|
if (lastPos != currentPos() || lastMask != m_buttonMask) {
|
||||||
emit mouseChanged(currentPos(), last,
|
emit mouseChanged(currentPos(), lastPos,
|
||||||
x11ToQtMouseButtons(m_buttonMask), x11ToQtMouseButtons(lastMask),
|
x11ToQtMouseButtons(m_buttonMask), x11ToQtMouseButtons(lastMask),
|
||||||
x11ToQtKeyboardModifiers(m_buttonMask), x11ToQtKeyboardModifiers(lastMask));
|
x11ToQtKeyboardModifiers(m_buttonMask), x11ToQtKeyboardModifiers(lastMask));
|
||||||
|
lastPos = currentPos();
|
||||||
|
lastMask = m_buttonMask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue