Index: ui/aura/window_event_dispatcher.cc |
diff --git a/ui/aura/window_event_dispatcher.cc b/ui/aura/window_event_dispatcher.cc |
index 559c9524748a85e10b0cb0fc40780d28baeb5aef..0361ce6e737e0e10fd4bbd39b7ce054e7e3ca398 100644 |
--- a/ui/aura/window_event_dispatcher.cc |
+++ b/ui/aura/window_event_dispatcher.cc |
@@ -314,6 +314,10 @@ ui::EventDispatchDetails WindowEventDispatcher::ProcessGestures( |
details = DispatchEvent(target, event.get()); |
if (details.dispatcher_destroyed || details.target_destroyed) |
break; |
+ // If the target window has moved off to a different WindowTreeHost, then |
+ // abort processing the rest of the events. |
+ if (!window()->Contains(target)) |
+ break; |
} |
return details; |
} |