diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index dbc8b368b39..9056eab2f12 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 cd60774ee6a..65ed11c6515 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 58799793aed..66fa59bfea5 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(event); - if (const_cast(this)->tabletDataForDevice(xdev->sourceid)) + if (!QCoreApplication::testAttribute(Qt::AA_CompressTabletEvents) && + const_cast(this)->tabletDataForDevice(xdev->sourceid)) return false; #endif // QT_NO_TABLETEVENT for (int j = nextIndex; j < eventqueue->size(); ++j) {