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

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: change the name to cancelled_touch_points 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
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/events/event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_event_dispatcher.cc
diff --git a/ui/aura/window_event_dispatcher.cc b/ui/aura/window_event_dispatcher.cc
index 7b40c71a06e473df88478d3fc1641b00d402875e..3619dcc8c92c490b9c59555ae149741aea103794 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);
@@ -437,10 +436,7 @@ void WindowEventDispatcher::PrepareEventForDispatch(ui::Event* event) {
// coordinate system to |window()|'s coordinate system.
return;
}
- if (event->IsMouseEvent() ||
- event->IsScrollEvent() ||
- event->IsTouchEvent() ||
- event->IsGestureEvent()) {
+ if (event->IsLocatedEvent()) {
TransformEventForDeviceScaleFactor(static_cast<ui::LocatedEvent*>(event));
}
}
@@ -530,6 +526,10 @@ bool WindowEventDispatcher::CanDispatchToConsumer(
}
void WindowEventDispatcher::DispatchCancelTouchEvent(ui::TouchEvent* event) {
+ // The touchcancel event's location is based on the last known location of
+ // the pointer, in dips. OnEventFromSource expects events with co-ordinates
+ // in raw pixels, so we convert back to raw pixels here.
+ event->UpdateForRootTransform(host_->GetRootTransform());
DispatchDetails details = OnEventFromSource(event);
if (details.dispatcher_destroyed)
return;
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698