Commit 581f2c72 authored by David Bokan's avatar David Bokan Committed by Commit Bot

Ignore XI2 window crossing for slave pointers

This fixes the attached bug since the cause is that the XTest pointer
is generating window crossing events (XI_Leave/XI_Enter) when implicitly
capturing the pointer for the slave device. For physical devices, these
events are generated only for the master pointer.

This CL fixes it by letting the crossing events pass through the
filtering checks applied by ShouldProcessXI2Event.
pointer_device_lookup_ stores only the master pointers so this filters
out the test slave.

I haven't been able to determine what makes the XTest pointer but the
fix makes sense since window crossing events only make sense on a
pointer and in that case we should always use the master.

Bug: 683434
Change-Id: Id96dacb6db49a95fae33105de2fcfe2b9f8d1b44
Reviewed-on: https://chromium-review.googlesource.com/883601
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531882}
parent 5f555d6f
......@@ -179,8 +179,12 @@ bool TouchFactory::ShouldProcessXI2Event(XEvent* xev) {
(virtual_core_keyboard_device_ == xiev->deviceid);
}
if (event->evtype != XI_ButtonPress &&
event->evtype != XI_ButtonRelease &&
// Don't automatically accept XI_Enter or XI_Leave. They should be checked
// against the pointer_device_lookup_ to prevent handling for slave devices.
// This happens for unknown reasons when using xtest.
// https://crbug.com/683434.
if (event->evtype != XI_ButtonPress && event->evtype != XI_ButtonRelease &&
event->evtype != XI_Enter && event->evtype != XI_Leave &&
event->evtype != XI_Motion) {
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment