Commit 07167cd2 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Add a workaround for KisShortcutsMatcher assert

The problem is caused by execution flow entering KisShortcutsMatcher
recursively because of doing QApplication::processEvent in the tool's
event hander.

CCBUG:408826
BACKPORT:krita/4.2
parent d1ced644
......@@ -592,16 +592,25 @@ bool KisTool::overrideCursorIfNotEditable()
bool KisTool::blockUntilOperationsFinished()
{
KisCanvas2 * kiscanvas = static_cast<KisCanvas2*>(canvas());
KisViewManager* viewManager = kiscanvas->viewManager();
return viewManager->blockUntilOperationsFinished(image());
// we cannot show any dialogs in the tool's code,
// it can make KisShortcutsMatcher crazy
image()->waitForDone();
return true;
// KisCanvas2 * kiscanvas = static_cast<KisCanvas2*>(canvas());
// KisViewManager* viewManager = kiscanvas->viewManager();
// return viewManager->blockUntilOperationsFinished(image());
}
void KisTool::blockUntilOperationsFinishedForced()
{
KisCanvas2 * kiscanvas = static_cast<KisCanvas2*>(canvas());
KisViewManager* viewManager = kiscanvas->viewManager();
viewManager->blockUntilOperationsFinishedForced(image());
// we cannot show any dialogs in the tool's code,
// it can make KisShortcutsMatcher crazy
image()->waitForDone();
// KisCanvas2 * kiscanvas = static_cast<KisCanvas2*>(canvas());
// KisViewManager* viewManager = kiscanvas->viewManager();
// viewManager->blockUntilOperationsFinishedForced(image());
}
bool KisTool::isActive() const
......
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