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++

Fix quick touch actions when Enter/Leave event do not arrive

Dmitry Kazakov7cca5aaa7300
diff --git a/libs/ui/input/kis_shortcut_matcher.cpp b/libs/ui/input/kis_shortcut_matcher.cpp
index e83911e40c..35959d8de0 100644
--- a/libs/ui/input/kis_shortcut_matcher.cpp
+++ b/libs/ui/input/kis_shortcut_matcher.cpp
@@ -1206,6 +1206,14 @@ void KisShortcutMatcher::setMaxTouchPointEvent(QTouchEvent *event)
bool KisShortcutMatcher::tryFireTapTouchShortcut(QTouchEvent *event, Qt::TouchPointStates allowedStates)
{
+ /**
+ * Touch actions don't usually send focus events, since they have no
+ * hover functionality, so they should be triggered unrelated to the
+ * current focus state.
+ */
+ if (m_d->actionsSuppressedIgnoreFocus())
+ return false;
+
KisTouchShortcut *goodCandidate = matchTouchShortcut(event, allowedStates, TouchShortcutMode::Tap);
if (goodCandidate) {
DEBUG_TOUCH_ACTION("starting", event)
@@ -1258,7 +1266,12 @@ bool KisShortcutMatcher::tryRunTouchShortcut(QTouchEvent* event, Qt::TouchPointS
{
KisTouchShortcut *goodCandidate = matchTouchShortcut(event, allowedStates, mode);
- if (m_d->actionsSuppressed())
+ /**
+ * Touch actions don't usually send focus events, since they have no
+ * hover functionality, so they should be triggered unrelated to the
+ * current focus state.
+ */
+ if (m_d->actionsSuppressedIgnoreFocus())
return false;
if (goodCandidate) {