Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Possibly fix asserts on MacOS

Dmitry Kazakov9914dde23f34
diff --git a/libs/ui/input/kis_shortcut_matcher.cpp b/libs/ui/input/kis_shortcut_matcher.cpp
index 91f228235b..e5e61bc6ec 100644
--- a/libs/ui/input/kis_shortcut_matcher.cpp
+++ b/libs/ui/input/kis_shortcut_matcher.cpp
@@ -336,14 +336,19 @@ bool KisShortcutMatcher::pointerMoved(QEvent *event)
{
Private::RecursionNotifier notifier(this);
- if (!m_d->runningShortcut || notifier.isInRecursion()) {
+ if (notifier.isInRecursion()) {
return false;
}
- KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(!m_d->touchShortcut && !m_d->nativeGestureShortcut, false);
+ bool retval = false;
- m_d->runningShortcut->action()->inputEvent(event);
- return true;
+ if (m_d->runningShortcut) {
+ KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(!m_d->touchShortcut && !m_d->nativeGestureShortcut, false);
+ m_d->runningShortcut->action()->inputEvent(event);
+ retval = true;
+ }
+
+ return retval;
}
void KisShortcutMatcher::enterEvent()
@@ -1052,7 +1057,7 @@ bool KisShortcutMatcher::tryRunNativeGestureShortcut(QNativeGestureEvent* event)
}
if (goodCandidate) {
- KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(m_d->runningShortcut, false);
+ KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(!m_d->runningShortcut, false);
// Because we don't match keyboard or button based actions with touch system, we have to ensure that we first
// deactivate an activated readyShortcut, to not throw other statemachines out of place.