summaryrefslogtreecommitdiffstats
path: root/views/touchui/touch_factory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/touchui/touch_factory.cc')
-rw-r--r--views/touchui/touch_factory.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/views/touchui/touch_factory.cc b/views/touchui/touch_factory.cc
index fefe35f..dcf88c8 100644
--- a/views/touchui/touch_factory.cc
+++ b/views/touchui/touch_factory.cc
@@ -179,10 +179,12 @@ void TouchFactory::UpdateDeviceList(Display* display) {
touch_device_list_.clear();
XDeviceInfo* devlist = XListInputDevices(display, &count);
for (int i = 0; i < count; i++) {
- const char* devtype = XGetAtomName(display, devlist[i].type);
- if (devtype && !strcmp(devtype, XI_TOUCHSCREEN)) {
- touch_device_lookup_[devlist[i].id] = true;
- touch_device_list_.push_back(devlist[i].id);
+ if (devlist[i].type) {
+ const char* devtype = XGetAtomName(display, devlist[i].type);
+ if (devtype && !strcmp(devtype, XI_TOUCHSCREEN)) {
+ touch_device_lookup_[devlist[i].id] = true;
+ touch_device_list_.push_back(devlist[i].id);
+ }
}
}
if (devlist)