summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorrbyers@chromium.org <rbyers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 22:52:54 +0000
committerrbyers@chromium.org <rbyers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 22:52:54 +0000
commit009d54e9ad9defb5c73198091c587ac5dbf91a37 (patch)
tree8a820270913ea4df8fe8b8e68204b2034a335191 /views
parent9f08e8bba1f4c14a4cb98c55067c1c6c21cedb03 (diff)
downloadchromium_src-009d54e9ad9defb5c73198091c587ac5dbf91a37.zip
chromium_src-009d54e9ad9defb5c73198091c587ac5dbf91a37.tar.gz
chromium_src-009d54e9ad9defb5c73198091c587ac5dbf91a37.tar.bz2
Tweak XInput2 event subscription
Combine MessagePumpGlibXs masters_ and floats_ fields into a single pointer_devices_ field. This is to make it easier for us to select the pointer devices of interest in one place. Also, don't attempt to call XFreeDeviceList if XListInputDevices returns null. This should only happen when XInput2 isn't supported, which isn't a real touchui scenario, but is useful for development scenarios. BUG=None TEST=None Review URL: http://codereview.chromium.org/6736029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/touchui/touch_factory.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/views/touchui/touch_factory.cc b/views/touchui/touch_factory.cc
index 66cdf6b..aeb1de2 100644
--- a/views/touchui/touch_factory.cc
+++ b/views/touchui/touch_factory.cc
@@ -43,6 +43,8 @@ TouchFactory::TouchFactory()
// NOTE: The new API for retrieving the list of devices (XIQueryDevice) does
// not provide enough information to detect a touch device. As a result, the
// old version of query function (XListInputDevices) is used instead.
+ // If XInput2 is not supported, this will return null (with count of -1) so
+ // we assume there cannot be any touch devices.
int count = 0;
XDeviceInfo* devlist = XListInputDevices(display, &count);
for (int i = 0; i < count; i++) {
@@ -52,7 +54,8 @@ TouchFactory::TouchFactory()
touch_device_list_.push_back(devlist[i].id);
}
}
- XFreeDeviceList(devlist);
+ if (devlist)
+ XFreeDeviceList(devlist);
}
TouchFactory::~TouchFactory() {