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

Unified Diff: ui/aura/window_event_dispatcher.cc

Issue 469523003: Add the actual location coordinates to the touch cancel event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: canceling the touch points from GestureConsumer Created 6 years, 4 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
Index: ui/aura/window_event_dispatcher.cc
diff --git a/ui/aura/window_event_dispatcher.cc b/ui/aura/window_event_dispatcher.cc
index 350066f7dd31e9e08c9ca72bf5f77377ab547e3e..6b36198ead19f98b77f09f89a341e3afcebfb81a 100644
--- a/ui/aura/window_event_dispatcher.cc
+++ b/ui/aura/window_event_dispatcher.cc
@@ -140,7 +140,6 @@ void WindowEventDispatcher::DispatchGestureEvent(ui::GestureEvent* event) {
DispatchDetails details = DispatchHeldEvents();
if (details.dispatcher_destroyed)
return;
-
Window* target = GetGestureTarget(event);
if (target) {
event->ConvertLocationToTarget(window(), target);
@@ -530,6 +529,11 @@ bool WindowEventDispatcher::CanDispatchToConsumer(
}
void WindowEventDispatcher::DispatchCancelTouchEvent(ui::TouchEvent* event) {
+ // We observe that the cancel touch event's location got scale twice,
+ // because the location we use to create the touch cancel event
+ // is already scaled, and we scale it again in the PrepareEventForDispatch
+ // function. Thus, we revert the location back in the below function.
tdresser 2014/08/15 14:22:04 I think this could be a bit clearer. The key thing
sadrul 2014/08/15 16:10:43 What if you we don't transform the event in Window
tdresser 2014/08/15 16:48:44 Yeah, that sounds reasonable.
lanwei 2014/08/15 17:09:28 This is a very good suggestion, I will give it a t
lanwei 2014/08/27 03:54:03 Done.
+ event->UpdateForRootTransform(host_->GetRootTransform());
DispatchDetails details = OnEventFromSource(event);
if (details.dispatcher_destroyed)
return;

Powered by Google App Engine
This is Rietveld 408576698