diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-23 07:30:35 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-23 07:30:35 +0000 |
commit | bb4e4f25dfe061cb83b899ba3e727416b9089ee2 (patch) | |
tree | 49b056dbc3008c0cb0d11fc6a5a8ec70ff4986b1 /ui/events | |
parent | 7ca9990d2c34e11d35ee3378144ad59b140f45f6 (diff) | |
download | chromium_src-bb4e4f25dfe061cb83b899ba3e727416b9089ee2.zip chromium_src-bb4e4f25dfe061cb83b899ba3e727416b9089ee2.tar.gz chromium_src-bb4e4f25dfe061cb83b899ba3e727416b9089ee2.tar.bz2 |
linux: Fix touch-event handling when the touch-screen is an attached slave.
Touchscreen device on chromeos is always a floating slave device. Touch works best
on linux if the touchscreen is a floating slave device too. But most other linux
apps don't process that well, and the touchscreen is usually an attached slave
device on these systems. So make sure chrome does receive touch-events correctly
from such devices.
BUG=327224
TBR=erg@chromium.org
Review URL: https://codereview.chromium.org/120503002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/events')
-rw-r--r-- | ui/events/x/events_x.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/events/x/events_x.cc b/ui/events/x/events_x.cc index e61ce10..2dc184e 100644 --- a/ui/events/x/events_x.cc +++ b/ui/events/x/events_x.cc @@ -277,10 +277,19 @@ EventType EventTypeFromNative(const base::NativeEvent& native_event) { XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(native_event->xcookie.data); + // This check works only for master and floating slave devices. That is + // why it is necessary to check for the XI_Touch* events in the following + // switch statement to account for attached-slave touchscreens. if (factory->IsTouchDevice(xievent->sourceid)) return GetTouchEventType(native_event); switch (xievent->evtype) { + case XI_TouchBegin: + return ui::ET_TOUCH_PRESSED; + case XI_TouchUpdate: + return ui::ET_TOUCH_MOVED; + case XI_TouchEnd: + return ui::ET_TOUCH_RELEASED; case XI_ButtonPress: { int button = EventButtonFromNative(native_event); if (button >= kMinWheelButton && button <= kMaxWheelButton) |