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; |
} |