diff options
author | Romain Pokrzywka <romain.pokrzywka@bluescape.com> | 2015-09-17 13:33:46 -0700 |
---|---|---|
committer | Romain Pokrzywka <romain.pokrzywka@gmail.com> | 2015-11-26 00:51:03 +0000 |
commit | 8d6fe1a37193ace073971820a6a6b22379e3fa95 (patch) | |
tree | e4e9405f59dd2ba9a4c3ff24f867ac7bd9145413 /src/gui/kernel/qwindow.cpp | |
parent | 50cd0daf29d434b78cc70bbf732ee33b2bc18600 (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/qwindow.cpp')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 3f971d700e..2b9340c04d 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1680,8 +1680,12 @@ void QWindow::destroy() QGuiApplicationPrivate::currentMouseWindow = parent(); if (QGuiApplicationPrivate::currentMousePressWindow == this) QGuiApplicationPrivate::currentMousePressWindow = parent(); - if (QGuiApplicationPrivate::tabletPressTarget == this) - QGuiApplicationPrivate::tabletPressTarget = parent(); + + for (int i = 0; i < QGuiApplicationPrivate::tabletDevicePoints.size(); ++i) { + QGuiApplicationPrivate::TabletPointData &pointData = QGuiApplicationPrivate::tabletDevicePoints[i]; + if (pointData.target == this) + pointData.target = parent(); + } bool wasVisible = isVisible(); d->visibilityOnDestroy = wasVisible && d->platformWindow; |