wayland/window: Pass popup configuration using relative coordinates

After popup placement rules have gone through the constraints engine has
ended up resulting in an actual move, pass the window configuration down
the path using relative coordinates, as that is what the next layer
(xdg-shell implementation) actually cares about.

In the future, this will also be helpful when the configured position is
not against the current state of the parent.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/705
This commit is contained in:
Jonas Ådahl
2020-02-13 22:20:15 +01:00
committed by Carlos Garnacho
parent 9b97e5ed58
commit d22f947bf5
5 changed files with 74 additions and 23 deletions

View File

@ -1145,8 +1145,8 @@ meta_wayland_xdg_popup_configure (MetaWaylandShellSurface *shell_surface,
return;
geometry_scale = meta_window_wayland_get_geometry_scale (parent_window);
x = (configuration->x - parent_window->rect.x) / geometry_scale;
y = (configuration->y - parent_window->rect.y) / geometry_scale;
x = configuration->rel_x / geometry_scale;
y = configuration->rel_y / geometry_scale;
xdg_popup_send_configure (xdg_popup->resource,
x, y,
configuration->width, configuration->height);