Change information
Commit message:
[Wayland] Ensure popup bounds are relative to parent window geometry
Update a few places in WaylandPopup to subtract
GetWindowGeometryOffsetInDIP() when translating popup bounds into parent
coordinates. This fixes misalignment and input routing issue in Blink's
Unbounded Elements popups.
Previously, the offset subtracting only occurred when an
OwnedWindowAnchor was provided [1]. If no anchor is provided,
XdgPopup::FillAnchorData() incorrectly calculates the anchor rect in the
parent's wl_surface coordinate space (containing the decoration area,
e.g. shadow or border). This conflicts with
WaylandPopup::HandlePopupConfigure() that assumes the bounds in window
geometry (no decoration area). As a result, unanchored popups were
incorrectly shifted by the parent window's decorated frame insets.
With this change, re-enable a few input routing tests in
UnboundedElementBrowserTest.
[1]
https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/host/wayland_popup.cc;l=81-87;drc=87abcfa5b16b689587f94f40e6e7de88db11313a
Test: ozone_unittests --test_filter="*WaylandWindow*"
Test: content_browsertests --test_filter="*UnboundedElement*"
Fixed: 529023344
Bug: 523970924
Change-Id: Ia5c150a21d81026cc2e4d1b34e984c60e1685c6f
Cr-Commit-Position: refs/heads/main@{#1674463}
Files:
- M content/browser/renderer_host/unbounded_element_browsertest.cc
- M ui/ozone/platform/wayland/host/wayland_popup.cc
Change size: S
Delta: 2 files changed, 6 insertions(+), 16 deletions(-)
Branch: refs/heads/main
Submit Requirements:
Code-Review: +1 by Alex Moshchuk, +1 by Thomas Anderson