Chromium Code Reviews| Index: ui/aura/mus/window_tree_client.cc |
| diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc |
| index b71391bc5bab8f5977235c55f7e570fe3f791b1c..7bc6ecccd7b5305f8c91bf4df877786ed24333ff 100644 |
| --- a/ui/aura/mus/window_tree_client.cc |
| +++ b/ui/aura/mus/window_tree_client.cc |
| @@ -1149,30 +1149,32 @@ void WindowTreeClient::OnWindowInputEvent(uint32_t event_id, |
| WindowTreeHostMus* host = GetWindowTreeHostMus(window); |
| DCHECK(host); |
| - // The location of the event is relative to |window|. As the event is handed |
| - // to WindowTreeHost we need it to be relative to WindowTreeHost. |
| - if (event->IsLocatedEvent()) { |
| - gfx::Point host_location = event->AsLocatedEvent()->location(); |
| - aura::Window::ConvertPointToTarget(window->GetWindow(), host->window(), |
| - &host_location); |
| - event->AsLocatedEvent()->set_location(host_location); |
| - } |
| - |
| EventAckHandler ack_handler(CreateEventResultCallback(event_id)); |
| // TODO(moshayedi): crbug.com/617222. No need to convert to ui::MouseEvent or |
| // ui::TouchEvent once we have proper support for pointer events. |
| if (event->IsMousePointerEvent()) { |
| if (event->type() == ui::ET_POINTER_WHEEL_CHANGED) { |
| ui::MouseWheelEvent mapped_event(*event->AsPointerEvent()); |
| + // Set the target window of this event to be the window received from mus |
| + // window server. EventProcessor will use this target window for event |
| + // dispatching instead of trying to find the right target window again. |
| + ui::Event::DispatcherApi dispatch_helper(&mapped_event); |
| + dispatch_helper.set_target(window->GetWindow()); |
| host->SendEventToProcessor(&mapped_event); |
| } else { |
| ui::MouseEvent mapped_event(*event->AsPointerEvent()); |
| + ui::Event::DispatcherApi dispatch_helper(&mapped_event); |
| + dispatch_helper.set_target(window->GetWindow()); |
| host->SendEventToProcessor(&mapped_event); |
| } |
| } else if (event->IsTouchPointerEvent()) { |
| ui::TouchEvent mapped_event(*event->AsPointerEvent()); |
| + ui::Event::DispatcherApi dispatch_helper(&mapped_event); |
| + dispatch_helper.set_target(window->GetWindow()); |
| host->SendEventToProcessor(&mapped_event); |
| } else { |
| + ui::Event::DispatcherApi dispatch_helper(event.get()); |
| + dispatch_helper.set_target(window->GetWindow()); |
| host->SendEventToProcessor(event.get()); |
|
sadrul
2017/02/08 00:24:38
This should go into some helper function, e.g. Win
riajiang
2017/02/11 00:43:39
Done.
|
| } |
| ack_handler.set_handled(event->handled()); |