b4dd757
From f1e39e7dea8634695263435f0bf912ce19c43195 Mon Sep 17 00:00:00 2001
b4dd757
From: Thomas Zander <t.zander@nokia.com>
b4dd757
Date: Thu, 4 Mar 2010 13:16:09 +0100
b4dd757
Subject: [PATCH] Make tablet detection work with new wacom drivers
b4dd757
b4dd757
wacom driver fixed a bug in assigning atom names where it messed
b4dd757
up the device names. Their solution apparently renamed the atoms
b4dd757
The type names used now are "STYLUS", "CURSOR", "ERASER", "PAD"
b4dd757
and "TOUCH" for each respective device.  This change detects
b4dd757
those as our tablet input devices.
b4dd757
b4dd757
Reviewed-by: Benjamin Poulain <benjamin.poulain@nokia.com>
b4dd757
Task-number: QTBUG-8599
b4dd757
---
b4dd757
 src/gui/kernel/qapplication_x11.cpp |    9 +++++++--
b4dd757
 src/gui/kernel/qt_x11_p.h           |    3 +++
b4dd757
 2 files changed, 10 insertions(+), 2 deletions(-)
b4dd757
b4dd757
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
b4dd757
index 121e9ec..25a7750 100644
b4dd757
--- a/src/gui/kernel/qapplication_x11.cpp
b4dd757
+++ b/src/gui/kernel/qapplication_x11.cpp
b4dd757
@@ -320,9 +320,14 @@ static const char * x11_atomnames = {
b4dd757
     "_XEMBED\0"
b4dd757
     "_XEMBED_INFO\0"
b4dd757
 
b4dd757
+    // Wacom old. (before version 0.10)
b4dd757
     "Wacom Stylus\0"
b4dd757
     "Wacom Cursor\0"
b4dd757
     "Wacom Eraser\0"
b4dd757
+
b4dd757
+    // Tablet
b4dd757
+    "STYLUS\0"
b4dd757
+    "ERASER\0"
b4dd757
 };
b4dd757
 
b4dd757
 Q_GUI_EXPORT QX11Data *qt_x11Data = 0;
b4dd757
@@ -2366,12 +2371,12 @@ void qt_init(QApplicationPrivate *priv, int,
b4dd757
                     gotStylus = true;
b4dd757
                 }
b4dd757
 #else
b4dd757
-                if (devs->type == ATOM(XWacomStylus)) {
b4dd757
+                if (devs->type == ATOM(XWacomStylus) || devs->type == ATOM(XTabletStylus)) {
b4dd757
                     deviceType = QTabletEvent::Stylus;
b4dd757
                     if (wacomDeviceName()->isEmpty())
b4dd757
                         wacomDeviceName()->append(devs->name);
b4dd757
                     gotStylus = true;
b4dd757
-                } else if (devs->type == ATOM(XWacomEraser)) {
b4dd757
+                } else if (devs->type == ATOM(XWacomEraser) || devs->type == ATOM(XTabletEraser)) {
b4dd757
                     deviceType = QTabletEvent::XFreeEraser;
b4dd757
                     gotEraser = true;
b4dd757
                 }
b4dd757
diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h
b4dd757
index d110084..14e04bb 100644
b4dd757
--- a/src/gui/kernel/qt_x11_p.h
b4dd757
+++ b/src/gui/kernel/qt_x11_p.h
b4dd757
@@ -675,6 +675,9 @@ struct QX11Data
b4dd757
         XWacomCursor,
b4dd757
         XWacomEraser,
b4dd757
 
b4dd757
+        XTabletStylus,
b4dd757
+        XTabletEraser,
b4dd757
+
b4dd757
         NPredefinedAtoms,
b4dd757
 
b4dd757
         _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms,
b4dd757
-- 
b4dd757
1.6.1
b4dd757