From bc7abc272d8eec05f0db5965ed5ef0e791489afe Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 12 Jul 2013 16:46:14 +0200 Subject: evdev tablet support on Linux Nowadays on at least some distros XInput presents the Wacom and other tablets with the TABLET atom instead of separate STYLUS and ERASER. Task-number: QTBUG-25329 Change-Id: I24d86be63ac2ffdeeb042d91644610feb6c9f4e7 Reviewed-by: Friedemann Kleint Reviewed-by: Andy Shaw --- src/gui/kernel/qapplication_x11.cpp | 4 +++- src/gui/kernel/qt_x11_p.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 377c2d6..9434080 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -326,6 +326,7 @@ static const char * x11_atomnames = { // Tablet "STYLUS\0" "ERASER\0" + "TABLET\0" }; Q_GUI_EXPORT QX11Data *qt_x11Data = 0; @@ -2462,7 +2463,8 @@ void qt_init(QApplicationPrivate *priv, int, gotStylus = true; } #else - if (devs->type == ATOM(XWacomStylus) || devs->type == ATOM(XTabletStylus)) { + // qDebug() << "found input device" << devs->name << "type" << devs->type << XGetAtomName(X11->display, devs->type); + if (devs->type == ATOM(XWacomStylus) || devs->type == ATOM(XTabletStylus) || devs->type == ATOM(XTablet)) { deviceType = QTabletEvent::Stylus; if (wacomDeviceName()->isEmpty()) wacomDeviceName()->append(devs->name); diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index 52a16e4..e65f871 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -688,6 +688,7 @@ struct QX11Data XTabletStylus, XTabletEraser, + XTablet, NPredefinedAtoms, -- cgit v0.12