summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2015-02-17 17:18:27 +0300
committerShawn Rutledge <shawn.rutledge@digia.com>2015-02-17 18:58:03 +0000
commit64d7bb9f555afb9e02cdf92d36f75655e7df2f1d (patch)
treefd4a8b5afdaf26084c31916df8cd928d3a9bb9c6 /src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
parentcb95fff1c7dfcfc00b1bf93d18b80485aca9dd0c (diff)
xcb: Check for the presence of XInput 2.2 before selecting touch events
Change-Id: I5309f9cdaadb87e0a577a0701d2c100d29525424 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
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