From aacdc0b6f12a150822e2866d2cc134bb3434bac0 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Mon, 22 Mar 2021 00:29:34 +0000 Subject: [PATCH] wayland: Apply states without needing a newly attached buffer Applying some states, such as the minimum and maximum toplevel size, do not require a new buffer and can operate on the old buffer. Requiring a client to commit a new buffer just to change such states prevents setting limits on an already existing surface buffer. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1716 Part-of: --- src/wayland/meta-wayland-legacy-xdg-shell.c | 6 ------ src/wayland/meta-wayland-wl-shell.c | 3 --- src/wayland/meta-wayland-xdg-shell.c | 6 ------ 3 files changed, 15 deletions(-) diff --git a/src/wayland/meta-wayland-legacy-xdg-shell.c b/src/wayland/meta-wayland-legacy-xdg-shell.c index 6dc8cc402..3c1ed8e93 100644 --- a/src/wayland/meta-wayland-legacy-xdg-shell.c +++ b/src/wayland/meta-wayland-legacy-xdg-shell.c @@ -709,9 +709,6 @@ meta_wayland_zxdg_toplevel_v6_post_apply_state (MetaWaylandSurfaceRole *surface if (!window) return; - if (!pending->newly_attached) - return; - old_geometry = xdg_surface_priv->geometry; surface_role_class = @@ -1016,9 +1013,6 @@ meta_wayland_zxdg_popup_v6_post_apply_state (MetaWaylandSurfaceRole *surface_ro META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_zxdg_popup_v6_parent_class); surface_role_class->post_apply_state (surface_role, pending); - if (!pending->newly_attached) - return; - if (!surface->buffer_ref->buffer) return; diff --git a/src/wayland/meta-wayland-wl-shell.c b/src/wayland/meta-wayland-wl-shell.c index 2388afd28..964c185b2 100644 --- a/src/wayland/meta-wayland-wl-shell.c +++ b/src/wayland/meta-wayland-wl-shell.c @@ -611,9 +611,6 @@ wl_shell_surface_role_apply_state (MetaWaylandSurfaceRole *surface_role, if (!window) return; - if (!pending->newly_attached) - return; - input_region = meta_wayland_surface_calculate_input_region (surface); if (!cairo_region_is_empty (input_region)) { diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index 5548e558c..c5f0d0b91 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -810,9 +810,6 @@ meta_wayland_xdg_toplevel_post_apply_state (MetaWaylandSurfaceRole *surface_rol META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_xdg_toplevel_parent_class); surface_role_class->post_apply_state (surface_role, pending); - if (!pending->newly_attached) - return; - window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface); geometry_changed = !meta_rectangle_equal (&old_geometry, &window_geometry); @@ -1164,9 +1161,6 @@ meta_wayland_xdg_popup_post_apply_state (MetaWaylandSurfaceRole *surface_role, if (!window) return; - if (!pending->newly_attached) - return; - if (!surface->buffer_ref->buffer) return;