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

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

Issue 2682443002: Fix event dispatching offset problem in the client-lib in high-dpi mode. (transform) (Closed)
Patch Set: 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 | no next file » | no next file with comments »
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..b7f687be130855706b62fa0bc651c0c837cea73b 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -1153,8 +1153,13 @@ void WindowTreeClient::OnWindowInputEvent(uint32_t event_id,
// 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);
+ gfx::Transform transform;
+ window->GetWindow()->layer()->GetTargetTransformRelativeTo(
+ host->window()->layer(), &transform);
+ transform.Scale(1, ScaleFactorForDisplay(window->GetWindow()));
+ auto transformed_host_location = gfx::Point3F(gfx::PointF(host_location));
+ transform.TransformPoint(&transformed_host_location);
+ host_location = gfx::ToFlooredPoint(transformed_host_location.AsPointF());
event->AsLocatedEvent()->set_location(host_location);
}
« 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