diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-08-06 10:45:40 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-08-06 10:54:01 +0200 |
commit | 77da617dc8e378a631ee8c15b1b414f16b87f147 (patch) | |
tree | 563f4f8e64e416774ea2b1599b896b589385168c /src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | |
parent | c17134e2db4d364855aa78a0d3c47cb9ef964dd9 (diff) | |
parent | 01f3530650f9f6f4c08520263a3c62281d81e3fc (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
doc/global/qt-cpp-defines.qdocconf
src/3rdparty/forkfd/forkfd.c
src/corelib/codecs/qtextcodec.cpp
src/corelib/kernel/qmetatype.cpp
src/corelib/tools/qset.qdoc
src/gui/accessible/qaccessible.cpp
src/gui/image/qpixmapcache.cpp
src/opengl/qgl.cpp
src/tools/qdoc/generator.cpp
src/widgets/kernel/qwidget.cpp
tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
Change-Id: I4fbe1fa756a54c6843aa75f4ef70a1069ba7b085
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection_xi2.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 4a347a3706..5a2ea74258 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -306,14 +306,13 @@ void QXcbConnection::xi2Select(xcb_window_t window) const bool pointerSelected = isAtLeastXI22() && xi2MouseEvents(); QSet<int> tabletDevices; #ifndef QT_NO_TABLETEVENT - if (!m_tabletData.isEmpty() && !pointerSelected) { + if (!m_tabletData.isEmpty()) { unsigned int tabletBitMask; unsigned char *xiTabletBitMask = reinterpret_cast<unsigned char *>(&tabletBitMask); QVector<XIEventMask> xiEventMask(m_tabletData.count()); - tabletBitMask = XI_ButtonPressMask; - tabletBitMask |= XI_ButtonReleaseMask; - tabletBitMask |= XI_MotionMask; - tabletBitMask |= XI_PropertyEventMask; + tabletBitMask = XI_PropertyEventMask; + if (!pointerSelected) + tabletBitMask |= XI_ButtonPressMask | XI_ButtonReleaseMask | XI_MotionMask; for (int i = 0; i < m_tabletData.count(); ++i) { int deviceId = m_tabletData.at(i).deviceId; tabletDevices.insert(deviceId); @@ -458,17 +457,6 @@ static inline qreal fixed1616ToReal(FP1616 val) } #endif // defined(XCB_USE_XINPUT21) || !defined(QT_NO_TABLETEVENT) -#if defined(XCB_USE_XINPUT21) -static qreal valuatorNormalized(double value, XIValuatorClassInfo *vci) -{ - if (value > vci->max) - value = vci->max; - if (value < vci->min) - value = vci->min; - return (value - vci->min) / (vci->max - vci->min); -} -#endif // XCB_USE_XINPUT21 - void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event) { if (xi2PrepareXIGenericDeviceEvent(event, m_xiOpCode)) { @@ -481,9 +469,11 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event) case XI_ButtonPress: case XI_ButtonRelease: case XI_Motion: +#ifdef XCB_USE_XINPUT22 case XI_TouchBegin: case XI_TouchUpdate: case XI_TouchEnd: +#endif { xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event); eventListener = windowEventListenerFromId(xiDeviceEvent->event); @@ -548,6 +538,15 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event) } #ifdef XCB_USE_XINPUT22 +static qreal valuatorNormalized(double value, XIValuatorClassInfo *vci) +{ + if (value > vci->max) + value = vci->max; + if (value < vci->min) + value = vci->min; + return (value - vci->min) / (vci->max - vci->min); +} + void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow) { xXIDeviceEvent *xiDeviceEvent = static_cast<xXIDeviceEvent *>(xiDevEvent); @@ -973,6 +972,8 @@ bool QXcbConnection::xi2HandleTabletEvent(void *event, TabletData *tabletData, Q // the pen on the XI 2.2+ path. if (xi2MouseEvents() && eventListener) eventListener->handleXIMouseEvent(reinterpret_cast<xcb_ge_event_t *>(event)); +#else + Q_UNUSED(eventListener); #endif switch (xiEvent->evtype) { |