Commit 4737bbe9 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Possibly fix freeze on painting when using weird tablet drivers

Some tablet drivers (Lenovo Yoga on Linux) have a bug [0] when the stylus
changes its own ID right in the middle of the stroke/hovering. Sometimes
they also generate spurious tabler press/release events. In Krita
such behavior may lead to recursive tool switching right in the middle
of TabletPress processing. Which could lead to a stroke started twice,
which basically leads to a freeze.

[0] - https://github.com/linuxwacom/input-wacom/issues/66#issuecomment-463349786
CCBUG:410797
parent 1ec268fa
......@@ -488,6 +488,8 @@ void KisShortcutMatcher::recoveryModifiersWithoutFocus(const QVector<Qt::Key> &k
void KisShortcutMatcher::lostFocusEvent(const QPointF &localPos)
{
Private::RecursionNotifier notifier(this);
if (m_d->runningShortcut) {
forceEndRunningShortcut(localPos);
}
......
......@@ -211,6 +211,8 @@ void KisToolFreehand::beginPrimaryAction(KoPointerEvent *event)
return;
}
KIS_SAFE_ASSERT_RECOVER_RETURN(!m_helper->isRunning());
setMode(KisTool::PAINT_MODE);
KisCanvas2 *canvas2 = dynamic_cast<KisCanvas2 *>(canvas());
......
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