summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-07-12 16:46:14 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-18 07:29:27 +0200
commitbc7abc272d8eec05f0db5965ed5ef0e791489afe (patch)
tree2ca4eeb84c8cd7a3420753cf080b94c453a7e525
parent7430d3f321b34a8a11470c55a2af1872a806726e (diff)
downloadqt4-tools-bc7abc272d8eec05f0db5965ed5ef0e791489afe.tar.gz
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 <Friedemann.Kleint@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
-rw-r--r--src/gui/kernel/qapplication_x11.cpp4
-rw-r--r--src/gui/kernel/qt_x11_p.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 377c2d6b5d..9434080e98 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 52a16e41d1..e65f871bc9 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,