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] -
parent 1ec268fa
...@@ -488,6 +488,8 @@ void KisShortcutMatcher::recoveryModifiersWithoutFocus(const QVector<Qt::Key> &k ...@@ -488,6 +488,8 @@ void KisShortcutMatcher::recoveryModifiersWithoutFocus(const QVector<Qt::Key> &k
void KisShortcutMatcher::lostFocusEvent(const QPointF &localPos) void KisShortcutMatcher::lostFocusEvent(const QPointF &localPos)
{ {
Private::RecursionNotifier notifier(this);
if (m_d->runningShortcut) { if (m_d->runningShortcut) {
forceEndRunningShortcut(localPos); forceEndRunningShortcut(localPos);
} }
...@@ -211,6 +211,8 @@ void KisToolFreehand::beginPrimaryAction(KoPointerEvent *event) ...@@ -211,6 +211,8 @@ void KisToolFreehand::beginPrimaryAction(KoPointerEvent *event)
return; return;
} }
setMode(KisTool::PAINT_MODE); setMode(KisTool::PAINT_MODE);
KisCanvas2 *canvas2 = dynamic_cast<KisCanvas2 *>(canvas()); KisCanvas2 *canvas2 = dynamic_cast<KisCanvas2 *>(canvas());
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment