Commit 8da530a1 authored by sadrul@chromium.org's avatar sadrul@chromium.org

x11: Make sure each XI2 key-event is not processed twice.

Because we listen to XInput2 events on AllDevices, we receive an event from
the slave device, followed by an event from the master device. It is not
necessary to process the events from the slave device, so ignore them.

BUG=368750
R=kpschoedel@chromium.org

Review URL: https://codereview.chromium.org/402763002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283879 0039d316-1c4b-4281-b951-d872f2087c98
parent c1b0313b
......@@ -174,6 +174,10 @@ bool TouchFactory::ShouldProcessXI2Event(XEvent* xev) {
return !touch_events_disabled_ && IsTouchDevice(xiev->deviceid);
}
#endif
// Make sure only key-events from the master device are processed.
if (event->evtype == XI_KeyPress || event->evtype == XI_KeyRelease)
return xiev->deviceid == xiev->sourceid;
if (event->evtype != XI_ButtonPress &&
event->evtype != XI_ButtonRelease &&
event->evtype != XI_Motion)
......
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