diff options
author | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2011-10-14 15:55:35 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-17 18:03:13 +0200 |
commit | 4521e2ec61c6eddd6d4a8454f84a05d9a3195f4b (patch) | |
tree | b872d62023e05c9299a491259abdedb72c783a73 /src/plugins/platforms/xcb/qxcbwindow.cpp | |
parent | 09cad13e49a9b6e6be565854fa4404d604939c03 (diff) |
Add multipoint touch support for Harmattan to the xcb platform plugin.
Proper multipoint touch support was only introduced in XInput2.1, but Harmattan uses
a tweaked version of XInput2.0 that transfers touch data through mouse events.
This patch applies on the xcb plugin a subset of the changes that were applied on the
Qt 4.7 that was shipped to Harmattan to get similar multipoint touch support.
Change-Id: Ifda7ad40de29d7ded1443d4f78b3ec3807303a9f
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 8c2b2d53fd..3b379c3caa 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -93,6 +93,10 @@ #include <X11/Xutil.h> #endif +#ifdef XCB_USE_XINPUT2_MAEMO +#include <X11/extensions/XInput2.h> +#endif + #if defined(XCB_USE_GLX) #include "qglxintegration.h" #include <QtPlatformSupport/private/qglxconvenience_p.h> @@ -322,6 +326,23 @@ void QXcbWindow::create() atom(QXcbAtom::WM_CLIENT_LEADER), XCB_ATOM_WINDOW, 32, 1, &leader)); +#ifdef XCB_USE_XINPUT2_MAEMO + if (connection()->isUsingXInput2()) { + XIEventMask xieventmask; + uchar bitmask[2] = { 0, 0 }; + + xieventmask.deviceid = XIAllMasterDevices; + xieventmask.mask = bitmask; + xieventmask.mask_len = sizeof(bitmask); + + XISetMask(bitmask, XI_ButtonPress); + XISetMask(bitmask, XI_ButtonRelease); + XISetMask(bitmask, XI_Motion); + + XISelectEvents(DISPLAY_FROM_XCB(this), m_window, &xieventmask, 1); + } +#endif + setWindowFlags(window()->windowFlags()); setWindowTitle(window()->windowTitle()); setWindowState(window()->windowState()); |