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

Unified Diff: views/focus/accelerator_handler_touch.cc

Issue 7792094: touchui: support XInput2 MT (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update patch set according to comment #33 Created 9 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 | « views/events/event_x.cc ('k') | views/touchui/touch_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/focus/accelerator_handler_touch.cc
diff --git a/views/focus/accelerator_handler_touch.cc b/views/focus/accelerator_handler_touch.cc
index c76e8badbe38773b3d2fd21bf235ddc388c381af..fbfa2f8ce503f9c501acb92a76cfc09a1b666481 100644
--- a/views/focus/accelerator_handler_touch.cc
+++ b/views/focus/accelerator_handler_touch.cc
@@ -47,6 +47,26 @@ bool DispatchX2Event(Widget* widget, XEvent* xev) {
// TODO(sad): We don't capture XInput2 events from keyboard yet.
break;
}
+#if defined(USE_XI2_MT)
+ case XI_TouchBegin:
+ case XI_TouchEnd:
+ case XI_TouchUpdate: {
+ Event::FromNativeEvent2 from_native;
+
+ // Hide the cursor when a touch event comes in.
+ TouchFactory::GetInstance()->SetCursorVisible(false, false);
+
+ // If the TouchEvent is processed by |widget|, then return.
+ TouchEvent touch(xev, from_native);
+ if (widget->OnTouchEvent(touch) != ui::TOUCH_STATUS_UNKNOWN)
+ return true;
+
+ // We do not want to generate a mouse event for an unprocessed touch
+ // event here. That is already done by the gesture manager in
+ // RootView::OnTouchEvent.
+ return false;
+ }
+#endif
case XI_ButtonPress:
case XI_ButtonRelease:
case XI_Motion: {
@@ -72,8 +92,8 @@ bool DispatchX2Event(Widget* widget, XEvent* xev) {
cookie->evtype == XI_ButtonRelease)
return false;
- // If the TouchEvent is processed by |root|, then return. Otherwise let
- // it fall through so it can be used as a MouseEvent, if desired.
+ // If the TouchEvent is processed by |widget|, then return. Otherwise
+ // let it fall through so it can be used as a MouseEvent, if desired.
TouchEvent touch(xev, from_native);
if (widget->OnTouchEvent(touch) != ui::TOUCH_STATUS_UNKNOWN)
return true;
« no previous file with comments | « views/events/event_x.cc ('k') | views/touchui/touch_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698