xdg-surface: fix window geometry handling

It was completely wrong: according to the protocol, the effective
geometry is only updated on commit time if there pending state has
new state from xdg_surface.set_window_geometry or
xdg_surface.set_window_geometry has never been sent at all.

This commit adds wlr_xdg_surface.geometry which correctly matches the
effective window geometry and removes now-useless
wlr_xdg_surface_get_geometry().
This commit is contained in:
Kirill Primak 2024-08-14 18:25:03 +03:00 committed by Alexander Orzechowski
parent a1298580cc
commit 5c98d1a04a
6 changed files with 62 additions and 52 deletions

View file

@ -34,10 +34,8 @@ static void scene_xdg_surface_update_position(
struct wlr_scene_xdg_surface *scene_xdg_surface) {
struct wlr_xdg_surface *xdg_surface = scene_xdg_surface->xdg_surface;
struct wlr_box geo = {0};
wlr_xdg_surface_get_geometry(xdg_surface, &geo);
wlr_scene_node_set_position(&scene_xdg_surface->surface_tree->node,
-geo.x, -geo.y);
-xdg_surface->geometry.x, -xdg_surface->geometry.y);
if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
struct wlr_xdg_popup *popup = xdg_surface->popup;