summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-02-23 11:24:04 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-02-23 11:24:07 +0100
commitd34353a065c443aac20376cbd88323480d769183 (patch)
treeda5d86b51c2cf7023356551c4c980849b35bab14 /src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
parent4e40b1952695f0b1086ef7b88e8514bd18cf96bf (diff)
parent571908f7fc8f5e4ef9a4dfd90102566f6f0fcad2 (diff)
Merge dev into 5.5
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection_xi2.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index c63a9c88bc..f225518cb9 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -274,21 +274,23 @@ void QXcbConnection::xi2Select(xcb_window_t window)
unsigned char *xiBitMask = reinterpret_cast<unsigned char *>(&bitMask);
#ifdef XCB_USE_XINPUT22
- bitMask |= XI_TouchBeginMask;
- bitMask |= XI_TouchUpdateMask;
- bitMask |= XI_TouchEndMask;
- XIEventMask mask;
- mask.mask_len = sizeof(bitMask);
- mask.mask = xiBitMask;
- if (!m_touchDevices.isEmpty()) {
- mask.deviceid = XIAllMasterDevices;
- Status result = XISelectEvents(xDisplay, window, &mask, 1);
- // If we select for touch events on the master pointer, XInput2
- // will not synthesize mouse events. This means Qt must do it,
- // which is also preferable, since Qt can control better when
- // to do so.
- if (m_xi2Minor >= 2 && result == Success)
- has_touch_without_mouse_emulation = true;
+ if (isUsingXInput22()) {
+ bitMask |= XI_TouchBeginMask;
+ bitMask |= XI_TouchUpdateMask;
+ bitMask |= XI_TouchEndMask;
+ XIEventMask mask;
+ mask.mask_len = sizeof(bitMask);
+ mask.mask = xiBitMask;
+ if (!m_touchDevices.isEmpty()) {
+ mask.deviceid = XIAllMasterDevices;
+ Status result = XISelectEvents(xDisplay, window, &mask, 1);
+ // If we select for touch events on the master pointer, XInput2
+ // will not synthesize mouse events. This means Qt must do it,
+ // which is also preferable, since Qt can control better when
+ // to do so.
+ if (result == Success)
+ has_touch_without_mouse_emulation = true;
+ }
}
#endif // XCB_USE_XINPUT22