From 6b2aa7846fa4569873c6413585604dba16ad12cd Mon Sep 17 00:00:00 2001 From: Alan Griffiths Date: Fri, 15 Sep 2023 13:01:03 +0100 Subject: [PATCH] Fix resize handling --- .../wayland_surface_observer.cpp | 2 +- tests/acceptance-tests/wayland/CMakeLists.txt | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/server/frontend_wayland/wayland_surface_observer.cpp b/src/server/frontend_wayland/wayland_surface_observer.cpp index 8285a9ea45d..baa03a9600a 100644 --- a/src/server/frontend_wayland/wayland_surface_observer.cpp +++ b/src/server/frontend_wayland/wayland_surface_observer.cpp @@ -77,7 +77,7 @@ void mf::WaylandSurfaceObserver::content_resized_to(ms::Surface const*, geom::Si run_on_wayland_thread_unless_window_destroyed( [content_size](Impl* impl, WindowWlSurfaceRole* window) { - if (content_size != impl->window_size) + if (impl->requested_size.value_or(impl->window_size) != content_size) { impl->requested_size = content_size; window->handle_resize(std::nullopt, content_size); diff --git a/tests/acceptance-tests/wayland/CMakeLists.txt b/tests/acceptance-tests/wayland/CMakeLists.txt index caaedda69d7..c8a30b18c3a 100644 --- a/tests/acceptance-tests/wayland/CMakeLists.txt +++ b/tests/acceptance-tests/wayland/CMakeLists.txt @@ -113,6 +113,41 @@ set(EXPECTED_FAILURES # Not yet implemented, see https://github.com/MirServer/mir/issues/2861 XdgPopupTest.when_parent_surface_is_moved_a_reactive_popup_is_moved + + # These tests depend on us not sending a configure event when the latest buffer was + # the "new" size. Even if we have sent a configure event with a different size + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/0 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/1 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/2 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/3 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/4 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/5 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/6 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/7 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/8 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/9 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/10 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/11 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/12 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/13 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/14 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/15 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/16 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/17 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/18 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/19 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/20 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/21 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/22 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/23 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/24 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/25 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/26 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/27 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/28 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/29 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/30 + Anchor/LayerSurfaceLayoutTest.maximized_xdg_toplevel_is_shrunk_for_exclusive_zone/31 ) if (MIR_SIGBUS_HANDLER_ENVIRONMENT_BROKEN)