Commit 4c349062 authored by Prabir Pradhan's avatar Prabir Pradhan Committed by Chromium LUCI CQ

exo: Expect display coordinates for StartDrag

In ClientControlledShellSurface, when default scale cancellation is
disabled, the client will send location values in the display's
coordinate space in pixels. The server previously converted the location
value into pixels but also expected that it was in the screen
coordinates and performed a conversion.

The server now assumes the location is already in the display's
coordinate when default scale cancellation is disabled, skipping the
conversion.

BUG=b:177089882
TEST=manual:  Try resizing and moving a PIP window on an external
display at different scale factors.

Change-Id: I10625001d0943c0eaaf1bd6decdb25f714e42b09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2618910Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Prabir Pradhan <prabirmsp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843352}
parent 4516b97d
......@@ -546,7 +546,12 @@ void ClientControlledShellSurface::AttemptToStartDrag(
if (toplevel_handler->gesture_target() ||
(mouse_pressed_handler && target->Contains(mouse_pressed_handler))) {
gfx::PointF point_in_root(location);
wm::ConvertPointFromScreen(target->GetRootWindow(), &point_in_root);
if (use_default_scale_cancellation_) {
// When default scale cancellation is enabled, the client sends the
// location in screen coordinates. Otherwise, the location should already
// be in the display's coordinates.
wm::ConvertPointFromScreen(target->GetRootWindow(), &point_in_root);
}
toplevel_handler->AttemptToStartDrag(
target, point_in_root, component,
ash::ToplevelWindowEventHandler::EndClosure());
......
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