Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Unified Diff: ui/aura/mus/window_tree_client.cc

Issue 2681613002: Avoid two targeting phases in aura client-lib and EventProcessor. (Closed)
Patch Set: comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/events/event_processor.cc » ('j') | ui/events/event_processor.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | ui/events/event_processor.cc » ('j') | ui/events/event_processor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698