ChromeRefresh2023 added client-side decorations to menus resulting
them to be positioned by Wayland improperly. That is, Wayland
must know the visible area and the insets that are set via
xdg_surface::set_surface_geometry. Otherwise, the xdg_positioner
will position the window by its entire size (decorations + visible
area).
Prior to this CL, the geometry was correctly set only for a toplevel
window (insets passed from the BrowserDesktopWindowTreeHostLinux).
Given there is no browser frame for a menu, but rather a MenuHost
owns the Widget, which owns the window tree host and the platform
window, the MenuHost is notified about creation of a native widget
now and sets decoration insets if `SupportsClientFrameShadow` is
true (same condition that is used by the browser window). Those
insets are further used by WaylandPopup to set its underlying
`xdg_surface` geometry using those insets.
Bug: 1487137
Change-Id: I87779e57cc3da7af0cc3ffce58a8e40ed331910c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5205030
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Alexander Dunaev <adunaev@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1252679}