summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@nokia.com>2011-10-14 15:55:35 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-17 18:03:13 +0200
commit4521e2ec61c6eddd6d4a8454f84a05d9a3195f4b (patch)
treeb872d62023e05c9299a491259abdedb72c783a73 /src/plugins/platforms/xcb/qxcbconnection.cpp
parent09cad13e49a9b6e6be565854fa4404d604939c03 (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/qxcbconnection.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index af5822f7f7..bdf308adb3 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -88,6 +88,9 @@ QT_BEGIN_NAMESPACE
QXcbConnection::QXcbConnection(const char *displayName)
: m_displayName(displayName ? QByteArray(displayName) : qgetenv("DISPLAY"))
+#ifdef XCB_USE_XINPUT2_MAEMO
+ , m_xinputData(0)
+#endif
#ifdef XCB_USE_DRI2
, m_dri2_major(0)
, m_dri2_minor(0)
@@ -155,6 +158,9 @@ QXcbConnection::QXcbConnection(const char *displayName)
initializeXFixes();
initializeXRender();
+#ifdef XCB_USE_XINPUT2_MAEMO
+ initializeXInput2();
+#endif
m_wmSupport = new QXcbWMSupport(this);
m_keyboard = new QXcbKeyboard(this);
@@ -173,6 +179,10 @@ QXcbConnection::~QXcbConnection()
qDeleteAll(m_screens);
+#ifdef XCB_USE_XINPUT2_MAEMO
+ finalizeXInput2();
+#endif
+
#ifdef XCB_POLL_FOR_QUEUED_EVENT
sendConnectionEvent(QXcbAtom::_QT_CLOSE_CONNECTION);
m_reader->wait();
@@ -530,6 +540,11 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
case XCB_PROPERTY_NOTIFY:
HANDLE_PLATFORM_WINDOW_EVENT(xcb_property_notify_event_t, window, handlePropertyNotifyEvent);
break;
+#ifdef XCB_USE_XINPUT2_MAEMO
+ case GenericEvent:
+ handleGenericEvent((xcb_ge_event_t*)event);
+ break;
+#endif
default:
handled = false;
break;
@@ -862,6 +877,22 @@ static const char * xcb_atomnames = {
// Tablet
"STYLUS\0"
"ERASER\0"
+
+ // XInput2
+ "Button Left\0"
+ "Button Middle\0"
+ "Button Right\0"
+ "Button Wheel Up\0"
+ "Button Wheel Down\0"
+ "Button Horiz Wheel Left\0"
+ "Button Horiz Wheel Right\0"
+ "Abs MT Position X\0"
+ "Abs MT Position Y\0"
+ "Abs MT Touch Major\0"
+ "Abs MT Touch Minor\0"
+ "Abs MT Pressure\0"
+ "Abs MT Tracking ID\0"
+ "Max Contacts\0"
};
xcb_atom_t QXcbConnection::atom(QXcbAtom::Atom atom)