Send out an additional TabletMove event before TabletPress.

Sometimes when a user puts the pen down too fast a TabletPress event will get triggered before a TabletMove event can occur. The app then assumes the user moved the pen very fast to the new position. The old position is there either (0,0), which often triggers the menu, or the last position the app received, which triggers apps like Xournal++ and Krita to paint a line from the old to the new position.
master
Xaver Hugl 2020-08-11 14:13:53 +02:00 committed by Aleix Pol Gonzalez
parent 147ee7726e
commit 3a85b57ec2
1 changed files with 5 additions and 1 deletions

View File

@ -1714,9 +1714,13 @@ public:
} case QEvent::TabletLeaveProximity:
tool->sendProximityOut();
break;
case QEvent::TabletPress:
case QEvent::TabletPress: {
const auto pos = event->globalPosF() - toplevel->bufferGeometry().topLeft();
tool->sendMotion(pos);
m_cursorByTool[tool]->setPos(event->globalPos());
tool->sendDown();
break;
}
case QEvent::TabletRelease:
tool->sendUp();
break;