Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: ui/events/x/touch_factory_x11.cc

Issue 538143002: Fix test for master device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Identify virtual core keyboard. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/x/touch_factory_x11.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/touch_factory_x11.cc
diff --git a/ui/events/x/touch_factory_x11.cc b/ui/events/x/touch_factory_x11.cc
index e016ea642a197d887fe3591619d8465db37dab92..f7024e419c09fb38004572219d6caaf86878fb51 100644
--- a/ui/events/x/touch_factory_x11.cc
+++ b/ui/events/x/touch_factory_x11.cc
@@ -32,6 +32,7 @@ TouchFactory::TouchFactory()
touch_events_disabled_(false),
touch_device_list_(),
max_touch_points_(-1),
+ virtual_core_keyboard_device_(-1),
id_generator_(0) {
if (!DeviceDataManagerX11::GetInstance()->IsXInput2Available())
return;
@@ -144,6 +145,8 @@ void TouchFactory::UpdateDeviceList(Display* display) {
}
#endif
pointer_device_lookup_[devinfo->deviceid] = true;
+ } else if (devinfo->use == XIMasterKeyboard) {
+ virtual_core_keyboard_device_ = devinfo->deviceid;
}
#if defined(USE_XI2_MT)
@@ -175,9 +178,11 @@ 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;
+ // Make sure only key-events from the virtual core keyboard are processed.
+ if (event->evtype == XI_KeyPress || event->evtype == XI_KeyRelease) {
+ return (virtual_core_keyboard_device_ < 0) ||
+ (virtual_core_keyboard_device_ == xiev->deviceid);
+ }
if (event->evtype != XI_ButtonPress &&
event->evtype != XI_ButtonRelease &&
« no previous file with comments | « ui/events/x/touch_factory_x11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698