summaryrefslogtreecommitdiffstats
path: root/kde/patch/krita/krita_qtabletevents.patch
blob: a1d386959875c071001d36530eb0ea32ffa6d799 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# NOTE: original patch: https://cgit.kde.org/krita.git/commit/?id=a3193fe2
# But first part (patch to ext_qt)) has been removed due to failure to apply.
# -- Eric Hameleers

From a3193fe273c3f2c3b5493f77724a4bc099ae5e36 Mon Sep 17 00:00:00 2001
From: Dmitry Kazakov <dimula73@gmail.com>
Date: Mon, 11 Mar 2019 16:49:31 +0300
Subject: Add a hacky patch that ensures QTabletEvents to be ignored in
 distribution builds

If we ensure that all the tablet events are ignored, then Qt
will always generate synthesized mouse events, avoiding the
problem of lost Enter/Leave events.

We also mark our own build of Qt about the presence of the fix
(therefore, it doesn't need this hack).
---
 libs/ui/input/kis_input_manager.cpp                | 20 ++++++++++++++++

index 30a4677..d173543 100644
--- a/libs/ui/input/kis_input_manager.cpp
+++ b/libs/ui/input/kis_input_manager.cpp
@@ -496,6 +496,13 @@ bool KisInputManager::eventFilterImpl(QEvent * event)
         //Reset signal compressor to prevent processing events before press late
         d->resetCompressor();
         d->eatOneMousePress();
+
+#if defined Q_OS_LINUX && !defined QT_HAS_ENTER_LEAVE_PATCH
+        // remove this hack when this patch is integrated:
+        // https://codereview.qt-project.org/#/c/255384/
+        event->setAccepted(false);
+#endif
+
         break;
     }
     case QEvent::TabletMove: {
@@ -517,6 +524,12 @@ bool KisInputManager::eventFilterImpl(QEvent * event)
          */
         d->blockMouseEvents();
 
+#if defined Q_OS_LINUX && !defined QT_HAS_ENTER_LEAVE_PATCH
+        // remove this hack when this patch is integrated:
+        // https://codereview.qt-project.org/#/c/255384/
+        event->setAccepted(false);
+#endif
+
         break;
     }
     case QEvent::TabletRelease: {
@@ -529,6 +542,13 @@ bool KisInputManager::eventFilterImpl(QEvent * event)
         retval = d->matcher.buttonReleased(tabletEvent->button(), tabletEvent);
         retval = true;
         event->setAccepted(true);
+
+#if defined Q_OS_LINUX && !defined QT_HAS_ENTER_LEAVE_PATCH
+        // remove this hack when this patch is integrated:
+        // https://codereview.qt-project.org/#/c/255384/
+        event->setAccepted(false);
+#endif
+
         break;
     }
 
-- 
cgit v1.1