Commit 8019c703 authored by spang's avatar spang Committed by Commit bot

ozone: dri: Remove distinction between root_location and location

Aura expects these to be the same, so just use location() everywhere.

This shouldn't affect anything because although we were passing along
screen location inside root_location(), Event::UpdateForRootTransform
sets it back to the transformed location(). So no code actually saw our
screen location.

BUG=none
TEST=unit tests, manual on link_freon with 2 monitors

Review URL: https://codereview.chromium.org/766833003

Cr-Commit-Position: refs/heads/master@{#308149}
parent bfd2ab22
...@@ -113,8 +113,7 @@ bool DriWindow::CanDispatchEvent(const PlatformEvent& ne) { ...@@ -113,8 +113,7 @@ bool DriWindow::CanDispatchEvent(const PlatformEvent& ne) {
if (event->IsLocatedEvent()) { if (event->IsLocatedEvent()) {
LocatedEvent* located_event = static_cast<LocatedEvent*>(event); LocatedEvent* located_event = static_cast<LocatedEvent*>(event);
return bounds_.Contains( return bounds_.Contains(gfx::ToFlooredPoint(located_event->location()));
gfx::ToFlooredPoint(located_event->root_location()));
} }
// TODO(spang): For non-ash builds we would need smarter keyboard focus. // TODO(spang): For non-ash builds we would need smarter keyboard focus.
...@@ -128,9 +127,10 @@ uint32_t DriWindow::DispatchEvent(const PlatformEvent& native_event) { ...@@ -128,9 +127,10 @@ uint32_t DriWindow::DispatchEvent(const PlatformEvent& native_event) {
if (event->IsLocatedEvent()) { if (event->IsLocatedEvent()) {
// Make the event location relative to this window's origin. // Make the event location relative to this window's origin.
LocatedEvent* located_event = static_cast<LocatedEvent*>(event); LocatedEvent* located_event = static_cast<LocatedEvent*>(event);
gfx::PointF location = located_event->root_location(); gfx::PointF location = located_event->location();
location -= bounds_.OffsetFromOrigin(); location -= bounds_.OffsetFromOrigin();
located_event->set_location(location); located_event->set_location(location);
located_event->set_root_location(location);
} }
DispatchEventFromNativeUiEvent( DispatchEventFromNativeUiEvent(
native_event, base::Bind(&PlatformWindowDelegate::DispatchEvent, native_event, base::Bind(&PlatformWindowDelegate::DispatchEvent,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment