Commit 3a85b57e authored by Xaver Hugl's avatar Xaver Hugl Committed by Aleix Pol Gonzalez
Browse files

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.
parent 147ee772
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment