summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication_p.h
diff options
context:
space:
mode:
authorRomain Pokrzywka <romain.pokrzywka@bluescape.com>2015-09-17 13:33:46 -0700
committerRomain Pokrzywka <romain.pokrzywka@gmail.com>2015-11-26 00:51:03 +0000
commit8d6fe1a37193ace073971820a6a6b22379e3fa95 (patch)
treee4e9405f59dd2ba9a4c3ff24f867ac7bd9145413 /src/gui/kernel/qguiapplication_p.h
parent50cd0daf29d434b78cc70bbf732ee33b2bc18600 (diff)
Accept concurrent input from multiple tablet devices in QGuiApplication
As a follow-up to 352c357e6f0785c0775a85151d6716b47aea1006 enabling support for multiple evdevtablet plugins at runtime (one per device), we also need to adjust the way QGuiApplication handles the events received from those plugins, in particular when multiple devices are sending tablet events concurrently. Replace the static members in QGuiApplication by a vector storing the same data per-device, so tablet press/release events can be recognized independently. Change-Id: Ie0975cdb03a8f6d05903e2e2e57ceb9de73a74a4 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qguiapplication_p.h')
-rw-r--r--src/gui/kernel/qguiapplication_p.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index 4d5797a8fa..5ef8dee8b7 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -198,13 +198,20 @@ public:
static int mousePressY;
static int mouse_double_click_distance;
static QPointF lastCursorPosition;
- static Qt::MouseButtons tabletState;
- static QWindow *tabletPressTarget;
static QWindow *currentMouseWindow;
static QWindow *currentMousePressWindow;
static Qt::ApplicationState applicationState;
static bool highDpiScalingUpdated;
+ struct TabletPointData {
+ TabletPointData(qint64 devId = 0) : deviceId(devId), state(Qt::NoButton), target(Q_NULLPTR) {}
+ qint64 deviceId;
+ Qt::MouseButtons state;
+ QWindow *target;
+ };
+ static QVector<TabletPointData> tabletDevicePoints;
+ static TabletPointData &tabletDevicePoint(qint64 deviceId);
+
#ifndef QT_NO_CLIPBOARD
static QClipboard *qt_clipboard;
#endif