Index: ui/aura/window_event_dispatcher.cc |
diff --git a/ui/aura/window_event_dispatcher.cc b/ui/aura/window_event_dispatcher.cc |
index 516d0ce48ca2fa755a26e9a004480ddcf919afde..2e42a9559614609352bad7f2b3e80ff9ba60bdd0 100644 |
--- a/ui/aura/window_event_dispatcher.cc |
+++ b/ui/aura/window_event_dispatcher.cc |
@@ -694,6 +694,15 @@ ui::EventDispatchDetails WindowEventDispatcher::SynthesizeMouseMoveEvent() { |
if (!synthesize_mouse_move_) |
return details; |
synthesize_mouse_move_ = false; |
+ |
+ // If one of the mouse buttons is currently down, then do not synthesize a |
+ // mouse-move event. In such cases, aura could synthesize a DRAGGED event |
+ // instead of a MOVED event, but in multi-display/multi-host scenarios, the |
+ // DRAGGED event can be synthesized in the incorrect host. So avoid |
+ // synthesizing any events at all. |
+ if (Env::GetInstance()->mouse_button_flags()) |
+ return details; |
+ |
gfx::Point root_mouse_location = GetLastMouseLocationInRoot(); |
if (!window()->bounds().Contains(root_mouse_location)) |
return details; |