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

Unified Diff: ui/ozone/platform/dri/dri_window.cc

Issue 766833003: ozone: dri: Remove distinction between root_location and location (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/dri_window.cc
diff --git a/ui/ozone/platform/dri/dri_window.cc b/ui/ozone/platform/dri/dri_window.cc
index 911ad423530df187f65c68785f56b959ed9cecad..770c9cfa42b689e4f740ca2951c113e4fb27522d 100644
--- a/ui/ozone/platform/dri/dri_window.cc
+++ b/ui/ozone/platform/dri/dri_window.cc
@@ -122,8 +122,7 @@ bool DriWindow::CanDispatchEvent(const PlatformEvent& ne) {
if (event->IsLocatedEvent()) {
LocatedEvent* located_event = static_cast<LocatedEvent*>(event);
- return bounds_.Contains(
- gfx::ToFlooredPoint(located_event->root_location()));
+ return bounds_.Contains(gfx::ToFlooredPoint(located_event->location()));
}
// TODO(spang): For non-ash builds we would need smarter keyboard focus.
@@ -137,9 +136,10 @@ uint32_t DriWindow::DispatchEvent(const PlatformEvent& native_event) {
if (event->IsLocatedEvent()) {
// Make the event location relative to this window's origin.
LocatedEvent* located_event = static_cast<LocatedEvent*>(event);
- gfx::PointF location = located_event->root_location();
+ gfx::PointF location = located_event->location();
location -= bounds_.OffsetFromOrigin();
located_event->set_location(location);
+ located_event->set_root_location(location);
}
DispatchEventFromNativeUiEvent(
native_event, base::Bind(&PlatformWindowDelegate::DispatchEvent,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698