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 4a01f63d9292b8c844a323fbaf85e7f49df5a1db..9dfb2bb38bc873add46b9cf6463304f2edebc316 100644 |
| --- a/ui/aura/mus/window_tree_client.cc |
| +++ b/ui/aura/mus/window_tree_client.cc |
| @@ -1100,8 +1100,19 @@ void WindowTreeClient::OnWindowInputEvent(uint32_t event_id, |
| return; |
| } |
| - EventAckHandler ack_handler(CreateEventResultCallback(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); |
|
sadrul
2016/11/30 21:41:29
This should update the root-location too I think?
|
| + } |
| + |
| + 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()) { |