From 8eb268fc3b5b81bcdd41d3d98dd9ec79b2138f36 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Thu, 4 Nov 2021 04:35:22 +0100 Subject: [PATCH] window/wayland: Differentiate between requested and direct resizes meta_window_wayland_finish_move_resize() is called for both, finishing a resize that has been requested through/by mutter and for resizes directly done by the client. This introduces a CLIENT_RESIZE flag to differentiate the former from the latter. Having this distinction is required to know what the last requested size by either the client or mutter is while ignoring older requests that might only have been applied now. This excludes client resizes when there are still pending configurations, because the resize is known to be only temporary. Part-of: --- src/core/window-private.h | 1 + src/wayland/meta-window-wayland.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/core/window-private.h b/src/core/window-private.h index 3bd75fe47..1b4323986 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -79,6 +79,7 @@ typedef enum META_MOVE_RESIZE_WAYLAND_STATE_CHANGED = 1 << 9, META_MOVE_RESIZE_FORCE_UPDATE_MONITOR = 1 << 10, META_MOVE_RESIZE_PLACEMENT_CHANGED = 1 << 11, + META_MOVE_RESIZE_WAYLAND_CLIENT_RESIZE = 1 << 12, } MetaMoveResizeFlags; typedef enum diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c index 12e9567d9..0927fabdd 100644 --- a/src/wayland/meta-window-wayland.c +++ b/src/wayland/meta-window-wayland.c @@ -944,6 +944,9 @@ meta_window_wayland_finish_move_resize (MetaWindow *window, flags = META_MOVE_RESIZE_WAYLAND_FINISH_MOVE_RESIZE; + if (!wl_window->pending_configurations) + flags |= META_MOVE_RESIZE_WAYLAND_CLIENT_RESIZE; + acked_configuration = acquire_acked_configuration (wl_window, pending); /* x/y are ignored when we're doing interactive resizing */