Commit 7cfa2375 authored by Prabir Pradhan's avatar Prabir Pradhan Committed by Commit Bot

exo: Do not scale the geometry sent to client in screen coordinates

The geometry sent to the client is in screen coordinates in DP, as
opposed to the display's coordinates. Scaling this value does not make
sense, as different displays could have different scales.

Ideally, we would send a display identfier and the geometry in display
coordinates. However, since we don't have a mapping of display_id to
wl_output yet in zcr_remote_shell, to avoid adding another
soon-to-be-deprecated event to the protocol, we just remove the scaling.

BUG=b:167267365
TEST=Manual with client-side change: verify input works on multiple
displays with different scale factors.

Change-Id: I250bb3f0c631d8783edae39a71b4fb84532d1729
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2388720
Commit-Queue: Prabir Pradhan <prabirmsp@chromium.org>
Reviewed-by: default avatarMitsuru Oshima (Slow: gardener) <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805492}
parent d483a133
...@@ -1190,9 +1190,12 @@ void ClientControlledShellSurface::OnPostWidgetCommit() { ...@@ -1190,9 +1190,12 @@ void ClientControlledShellSurface::OnPostWidgetCommit() {
UpdateBackdrop(); UpdateBackdrop();
if (geometry_changed_callback_) { if (geometry_changed_callback_) {
const float scale = 1.f / GetClientToDpScale(); // Since the visible bounds are in screen coordinates, do not scale these
const gfx::Rect scaled = gfx::ScaleToRoundedRect(GetVisibleBounds(), scale); // bounds with the display's scale before sending them.
geometry_changed_callback_.Run(scaled); // TODO(b/167286795): Instead of sending bounds in screen coordinates, send
// the bounds in the display along with the display information, similar to
// the bounds_changed_callback_.
geometry_changed_callback_.Run(GetVisibleBounds());
} }
// Apply new top inset height. // Apply new top inset height.
......
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