summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorThomas Zander <thomas.zander@trolltech.com>2009-04-22 08:18:26 (GMT)
committerThomas Zander <thomas.zander@trolltech.com>2009-04-22 08:50:24 (GMT)
commite238e7b06f4c90c4b36621ade07329264fa7bed3 (patch)
treefcea140097e76b47fe2e01c128365464a4391d4f /src/gui
parentdb4e2a600c53ad857d7fa3f7d84ac995215ecf93 (diff)
downloadQt-e238e7b06f4c90c4b36621ade07329264fa7bed3.zip
Qt-e238e7b06f4c90c4b36621ade07329264fa7bed3.tar.gz
Qt-e238e7b06f4c90c4b36621ade07329264fa7bed3.tar.bz2
Fixes: Wacom tool-id lookup expects hardcoded wacom device identifiers from xorg.conf
Details: use device name previously found using x-atoms instead of a hardcoded one. RevBy: Thiago Macieira Task: 210132 (followup)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qapplication_x11.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 366e576..4814f1a 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -1583,6 +1583,7 @@ static PtrWacomConfigOpenDevice ptrWacomConfigOpenDevice = 0;
static PtrWacomConfigGetRawParam ptrWacomConfigGetRawParam = 0;
static PtrWacomConfigCloseDevice ptrWacomConfigCloseDevice = 0;
static PtrWacomConfigTerm ptrWacomConfigTerm = 0;
+Q_GLOBAL_STATIC(QByteArray, wacomDeviceName)
#endif
#endif
@@ -2377,6 +2378,8 @@ void qt_init(QApplicationPrivate *priv, int,
#else
if (devs->type == ATOM(XWacomStylus)) {
deviceType = QTabletEvent::Stylus;
+ if (wacomDeviceName()->isEmpty())
+ wacomDeviceName()->append(devs->name);
gotStylus = true;
} else if (devs->type == ATOM(XWacomEraser)) {
deviceType = QTabletEvent::XFreeEraser;
@@ -4511,8 +4514,7 @@ void fetchWacomToolId(int &deviceType, qint64 &serialId)
WACOMCONFIG *config = ptrWacomConfigInit(X11->display, 0);
if (config == 0)
return;
- const char *name = "stylus"; // TODO get this from the X config instead (users may have called it differently)
- WACOMDEVICE *device = ptrWacomConfigOpenDevice (config, name);
+ WACOMDEVICE *device = ptrWacomConfigOpenDevice (config, wacomDeviceName()->constData());
if (device == 0)
return;
unsigned keys[1];