From 36a6235f3a952f3a36a6534f0e05854b8cffd20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 8 Jun 2020 10:06:44 +0200 Subject: [PATCH] wayland/xdg-shell: Don't use xdg_surface private to get window geometry We already used the actual API in the same function, move that call a bit higher up to and use the variable in more places. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1295 (cherry picked from commit 4c0aa2afcadef845a8c942bd4a67f66e37e4c75b) --- src/wayland/meta-wayland-xdg-shell.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index 4ed4423bd..05577d648 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -790,6 +790,8 @@ meta_wayland_xdg_toplevel_post_apply_state (MetaWaylandSurfaceRole *surface_rol MetaWaylandSurfaceRoleClass *surface_role_class; MetaWindow *window; MetaRectangle old_geometry; + MetaRectangle window_geometry; + gboolean geometry_changed; window = meta_wayland_surface_get_window (surface); @@ -805,13 +807,11 @@ meta_wayland_xdg_toplevel_post_apply_state (MetaWaylandSurfaceRole *surface_rol if (!pending->newly_attached) return; - geometry_changed = !meta_rectangle_equal (&old_geometry, &xdg_surface_priv->geometry); + window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface); + geometry_changed = !meta_rectangle_equal (&old_geometry, &window_geometry); if (geometry_changed || pending->has_acked_configure_serial) { - MetaRectangle window_geometry; - - window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface); meta_window_wayland_finish_move_resize (window, window_geometry, pending); } else if (pending->dx != 0 || pending->dy != 0)