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()
|
||||
{
|
||||
const QPoint last = currentPos();
|
||||
const uint16_t lastMask = m_buttonMask;
|
||||
static QPoint lastPos = currentPos();
|
||||
static uint16_t lastMask = m_buttonMask;
|
||||
doGetPos(); // Update if needed
|
||||
if (last != currentPos() || lastMask != m_buttonMask) {
|
||||
emit mouseChanged(currentPos(), last,
|
||||
if (lastPos != currentPos() || lastMask != m_buttonMask) {
|
||||
emit mouseChanged(currentPos(), lastPos,
|
||||
x11ToQtMouseButtons(m_buttonMask), x11ToQtMouseButtons(lastMask),
|
||||
x11ToQtKeyboardModifiers(m_buttonMask), x11ToQtKeyboardModifiers(lastMask));
|
||||
lastPos = currentPos();
|
||||
lastMask = m_buttonMask;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue