Chromium Code Reviews| Index: ui/aura/root_window.cc |
| diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc |
| index 128a04424d45ae084e9b6ecfbd659e1d1b42979a..34888e097bc9b98574d902a68c2ec65be872b39c 100644 |
| --- a/ui/aura/root_window.cc |
| +++ b/ui/aura/root_window.cc |
| @@ -398,6 +398,12 @@ void RootWindow::MoveCursorToInternal(const gfx::Point& root_location, |
| ui::EventDispatchDetails RootWindow::DispatchMouseEnterOrExit( |
| const ui::MouseEvent& event, |
| ui::EventType type) { |
| + |
| + if (event.type() != ui::ET_MOUSE_CAPTURE_CHANGED && |
| + !(event.flags() & ui::EF_IS_SYNTHESIZED)) { |
| + SetLastMouseLocation(window(), event.root_location()); |
| + } |
|
oshima
2014/02/11 19:43:38
This was necessary because EnterOrExit may cause e
sadrul
2014/02/11 21:26:20
Can you explain this a bit more? The early returns
|
| + |
| if (!mouse_moved_handler_ || !mouse_moved_handler_->delegate()) |
| return DispatchDetails(); |
| @@ -793,7 +799,6 @@ ui::EventDispatchDetails RootWindow::SynthesizeMouseMoveEvent() { |
| return details; |
| gfx::Point host_mouse_location = root_mouse_location; |
| host()->ConvertPointToHost(&host_mouse_location); |
| - |
| ui::MouseEvent event(ui::ET_MOUSE_MOVED, |
| host_mouse_location, |
| host_mouse_location, |
| @@ -811,10 +816,11 @@ void RootWindow::PreDispatchLocatedEvent(Window* target, |
| if (!dispatching_held_event_ && |
| (event->IsMouseEvent() || event->IsScrollEvent())) { |
| - if (event->type() != ui::ET_MOUSE_CAPTURE_CHANGED) |
| - SetLastMouseLocation(window(), event->root_location()); |
| - if (!(event->flags() & ui::EF_IS_SYNTHESIZED)) |
| + if (!(event->flags() & ui::EF_IS_SYNTHESIZED)) { |
|
sadrul
2014/02/13 04:38:59
Merge the two if's?
oshima
2014/02/13 15:25:32
Done.
|
| + if (event->type() != ui::ET_MOUSE_CAPTURE_CHANGED) |
| + SetLastMouseLocation(window(), event->root_location()); |
| synthesize_mouse_move_ = false; |
| + } |
| } |
| } |