[mutter] window/wayland: Differentiate between requested and direct resizes



commit 8eb268fc3b5b81bcdd41d3d98dd9ec79b2138f36
Author: Sebastian Keller <skeller gnome org>
Date:   Thu Nov 4 04:35:22 2021 +0100

    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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2066>

 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 3bd75fe47a..1b43239865 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 12e9567d9c..0927fabddd 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 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]