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

Unified Diff: ui/aura/root_window.cc

Issue 135483002: aura: Fix a couple of issues related to held touch events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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/root_window.h ('k') | ui/aura/root_window_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window.cc
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 01f62c704cf36a9ef2dad63ddffb65fd21fa39ed..6efdbb6a592ee213aaafeb5cdeb62a28b837b619 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -625,14 +625,17 @@ ui::EventDispatchDetails RootWindow::PostDispatchEvent(ui::EventTarget* target,
#endif
if (event.IsTouchEvent() && !details.target_destroyed) {
- ui::TouchEvent orig_event(static_cast<const ui::TouchEvent&>(event),
- static_cast<Window*>(event.target()), window());
- // Get the list of GestureEvents from GestureRecognizer.
- scoped_ptr<ui::GestureRecognizer::Gestures> gestures;
- gestures.reset(ui::GestureRecognizer::Get()->
- ProcessTouchEventForGesture(orig_event, event.result(),
- static_cast<Window*>(target)));
- return ProcessGestures(gestures.get());
+ // Do not let 'held' touch events contribute to any gestures.
+ if (!held_move_event_ || !held_move_event_->IsTouchEvent()) {
+ ui::TouchEvent orig_event(static_cast<const ui::TouchEvent&>(event),
+ static_cast<Window*>(event.target()), window());
+ // Get the list of GestureEvents from GestureRecognizer.
+ scoped_ptr<ui::GestureRecognizer::Gestures> gestures;
+ gestures.reset(ui::GestureRecognizer::Get()->
+ ProcessTouchEventForGesture(orig_event, event.result(),
+ static_cast<Window*>(target)));
+ return ProcessGestures(gestures.get());
+ }
}
return details;
@@ -761,9 +764,7 @@ ui::EventDispatchDetails RootWindow::OnHostMouseEventImpl(
ui::MouseEvent* event) {
if (IsEventCandidateForHold(*event)) {
if (move_hold_count_) {
- Window* null_window = static_cast<Window*>(NULL);
- held_move_event_.reset(
- new ui::MouseEvent(*event, null_window, null_window));
+ held_move_event_.reset(new ui::MouseEvent(*event));
event->SetHandled();
return DispatchDetails();
} else {
@@ -1000,7 +1001,7 @@ void RootWindow::PreDispatchTouchEvent(Window* target,
case ui::ET_TOUCH_MOVED:
if (move_hold_count_) {
- held_move_event_.reset(new ui::TouchEvent(*event));
+ held_move_event_.reset(new ui::TouchEvent(*event, target, window()));
event->SetHandled();
return;
}
« no previous file with comments | « ui/aura/root_window.h ('k') | ui/aura/root_window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698