summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_x11.cpp
diff options
context:
space:
mode:
authorThomas Zander <thomas.zander@trolltech.com>2009-04-20 15:35:25 (GMT)
committerThomas Zander <thomas.zander@trolltech.com>2009-04-21 09:01:38 (GMT)
commit5306337bf3ba9b770824ae889e31e991a4e03ade (patch)
tree658e2063b83b701c6dbb536eb68d6431f652ac34 /src/gui/kernel/qapplication_x11.cpp
parent4708acb70e1e71bf22e85f7335dcaf1401aba3bb (diff)
downloadQt-5306337bf3ba9b770824ae889e31e991a4e03ade.zip
Qt-5306337bf3ba9b770824ae889e31e991a4e03ade.tar.gz
Qt-5306337bf3ba9b770824ae889e31e991a4e03ade.tar.bz2
Fixes: Qt expects hardcoded wacom device identifiers from xorg.conf
Task: 210132 RevBy: Bradley T. Hughes Details:Make wacom detection use atoms instead of string compares
Diffstat (limited to 'src/gui/kernel/qapplication_x11.cpp')
-rw-r--r--src/gui/kernel/qapplication_x11.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index b1270bc..366e576 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -294,6 +294,10 @@ static const char * x11_atomnames = {
// XEMBED
"_XEMBED\0"
"_XEMBED_INFO\0"
+
+ "Wacom Stylus\0"
+ "Wacom Cursor\0"
+ "Wacom Eraser\0"
};
Q_GUI_EXPORT QX11Data *qt_x11Data = 0;
@@ -2350,13 +2354,6 @@ void qt_init(QApplicationPrivate *priv, int,
XAxisInfoPtr a;
XDevice *dev = 0;
-#if !defined(Q_OS_IRIX)
- // XFree86 divides a stylus and eraser into 2 devices, so we must do for both...
- const QString XFREENAMESTYLUS = QLatin1String("stylus");
- const QString XFREENAMEPEN = QLatin1String("pen");
- const QString XFREENAMEERASER = QLatin1String("eraser");
-#endif
-
if (X11->ptrXListInputDevices) {
devices = X11->ptrXListInputDevices(X11->display, &ndev);
if (!devices)
@@ -2371,18 +2368,17 @@ void qt_init(QApplicationPrivate *priv, int,
gotStylus = false;
gotEraser = false;
- QString devName = QString::fromLocal8Bit(devs->name).toLower();
#if defined(Q_OS_IRIX)
+ QString devName = QString::fromLocal8Bit(devs->name).toLower();
if (devName == QLatin1String(WACOM_NAME)) {
deviceType = QTabletEvent::Stylus;
gotStylus = true;
}
#else
- if (devName.startsWith(XFREENAMEPEN)
- || devName.startsWith(XFREENAMESTYLUS)) {
+ if (devs->type == ATOM(XWacomStylus)) {
deviceType = QTabletEvent::Stylus;
gotStylus = true;
- } else if (devName.startsWith(XFREENAMEERASER)) {
+ } else if (devs->type == ATOM(XWacomEraser)) {
deviceType = QTabletEvent::XFreeEraser;
gotEraser = true;
}