summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-04-24 14:14:58 -0700
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-05-01 04:41:27 +0000
commit06713ded600d2d1fb5469dc31373a1878c366485 (patch)
tree1bda9f71f3442e31aadbf5bd15d4cff927f42ea5
parent5398aaabfc968c198137aa9b28187d9d2a57aa40 (diff)
Introducing AA_CompressTabletEvents
Tablet events compression has been missing since commit 60cd1c67759642018ef93cc45a90714729100d9d in 5.6.1, and there's no way to bring the old behavior back. Since tablet events are not taken into account by AA_CompressHighFrequencyEvents on purpose, we introduce this new flag. This new flag is conditional to AA_CompressHighFrequencyEvents being set in order for it to be effective. [ChangeLog][QtCore][Tablet support] If the application attribute AA_CompressTabletEvents is set in addition to AA_CompressHighFrequencyEvents, even the QTabletEvents will be compressed (only on the X11 platform so far). AA_CompressHighFrequencyEvents does not enable compression of tablet events by itself, because paint applications typically need to process all possible tablet events in order to draw the smoothest curves. Change-Id: Ie7434ab4f9a4c64f2626c75e661cfd0d6cd22896 Task-number: QTBUG-44964 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Wayne Arnold <wayne.arnold@autodesk.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/corelib/global/qnamespace.h1
-rw-r--r--src/corelib/global/qnamespace.qdoc9
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp3
3 files changed, 11 insertions, 2 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index dbc8b368b3..9056eab2f1 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -509,6 +509,7 @@ public:
AA_DontCheckOpenGLContextThreadAffinity = 26,
AA_DisableShaderDiskCache = 27,
AA_DontShowShortcutsInContextMenus = 28,
+ AA_CompressTabletEvents = 29,
// Add new attributes before this line
AA_AttributeCount
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index cd60774ee6..65ed11c651 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -250,7 +250,14 @@
(In the future, the compression feature may be implemented across platforms.)
You can test the attribute to see whether compression is enabled.
If your application needs to handle all events with no compression,
- you can unset this attribute. This value has been added in Qt 5.7.
+ you can unset this attribute. Notice that input events from tablet devices
+ will not be compressed. See AA_CompressTabletEvents if you want these to be
+ compressed as well. This value has been added in Qt 5.7.
+
+ \value AA_CompressTabletEvents Enables compression of input events from tablet devices.
+ Notice that AA_CompressHighFrequencyEvents must be true for events compression
+ to be enabled, and that this flag extends the former to tablet events. Its default
+ value is false. This value has been added in Qt 5.10.
\value AA_DontCheckOpenGLContextThreadAffinity When making a context
current using QOpenGLContext, do not check that the
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 58799793ae..66fa59bfea 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -1562,7 +1562,8 @@ bool QXcbConnection::compressEvent(xcb_generic_event_t *event, int currentIndex,
if (isXIType(event, m_xiOpCode, XI_Motion)) {
#ifndef QT_NO_TABLETEVENT
xXIDeviceEvent *xdev = reinterpret_cast<xXIDeviceEvent *>(event);
- if (const_cast<QXcbConnection *>(this)->tabletDataForDevice(xdev->sourceid))
+ if (!QCoreApplication::testAttribute(Qt::AA_CompressTabletEvents) &&
+ const_cast<QXcbConnection *>(this)->tabletDataForDevice(xdev->sourceid))
return false;
#endif // QT_NO_TABLETEVENT
for (int j = nextIndex; j < eventqueue->size(); ++j) {