From f6390864a76eac26b9f3122ad48b9d5238806539 Mon Sep 17 00:00:00 2001 From: "saintlou@chromium.org" Date: Thu, 21 Apr 2011 20:28:01 +0000 Subject: Select on slave pointers instead of master pointers. BUG=80193 TEST=none Review URL: http://codereview.chromium.org/6891005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82544 0039d316-1c4b-4281-b951-d872f2087c98 --- views/touchui/touch_factory.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'views/touchui') diff --git a/views/touchui/touch_factory.cc b/views/touchui/touch_factory.cc index dc6fb96..f9b859c 100644 --- a/views/touchui/touch_factory.cc +++ b/views/touchui/touch_factory.cc @@ -185,10 +185,12 @@ void TouchFactory::UpdateDeviceList(Display* display) { // Instead of asking X for the list of devices all the time, let's maintain a // list of pointer devices we care about. - // It is not necessary to select for slave devices. XInput2 provides enough - // information to the event callback to decide which slave device triggered - // the event, thus decide whether the 'pointer event' is a 'mouse event' or a - // 'touch event'. + // It should not be necessary to select for slave devices. XInput2 provides + // enough information to the event callback to decide which slave device + // triggered the event, thus decide whether the 'pointer event' is a + // 'mouse event' or a 'touch event'. + // However, on some desktops, some events from a master pointer are + // not delivered to the client. So we select for slave devices instead. // If the touch device has 'GrabDevice' set and 'SendCoreEvents' unset (which // is possible), then the device is detected as a floating device, and a // floating device is not connected to a master device. So it is necessary to @@ -197,7 +199,7 @@ void TouchFactory::UpdateDeviceList(Display* display) { XIDeviceInfo* devices = XIQueryDevice(display, XIAllDevices, &count); for (int i = 0; i < count; i++) { XIDeviceInfo* devinfo = devices + i; - if (devinfo->use == XIFloatingSlave || devinfo->use == XIMasterPointer) { + if (devinfo->use == XIFloatingSlave || devinfo->use == XISlavePointer) { pointer_device_lookup_[devinfo->deviceid] = true; } } -- cgit v1.1