[mutter] wayland/window-configuration: Track resize flags and gravity too



commit 6c82feb1b83c982b24cb7a2fd2f8cdaf5b515c29
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Feb 14 09:55:00 2020 +0100

    wayland/window-configuration: Track resize flags and gravity too
    
    Will later be used to determine in what way a pending configuration will
    resize.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/705

 src/wayland/meta-wayland-window-configuration.c | 13 +++++++++----
 src/wayland/meta-wayland-window-configuration.h | 14 ++++++++++----
 src/wayland/meta-window-wayland.c               |  8 ++++++--
 3 files changed, 25 insertions(+), 10 deletions(-)
---
diff --git a/src/wayland/meta-wayland-window-configuration.c b/src/wayland/meta-wayland-window-configuration.c
index 81a321dfe..013f10a73 100644
--- a/src/wayland/meta-wayland-window-configuration.c
+++ b/src/wayland/meta-wayland-window-configuration.c
@@ -25,10 +25,12 @@
 static uint32_t global_serial_counter = 0;
 
 MetaWaylandWindowConfiguration *
-meta_wayland_window_configuration_new (int x,
-                                       int y,
-                                       int width,
-                                       int height)
+meta_wayland_window_configuration_new (int                 x,
+                                       int                 y,
+                                       int                 width,
+                                       int                 height,
+                                       MetaMoveResizeFlags flags,
+                                       MetaGravity         gravity)
 {
   MetaWaylandWindowConfiguration *configuration;
 
@@ -43,6 +45,9 @@ meta_wayland_window_configuration_new (int x,
     .has_size = TRUE,
     .width = width,
     .height = height,
+
+    .gravity = gravity,
+    .flags = flags,
   };
 
   return configuration;
diff --git a/src/wayland/meta-wayland-window-configuration.h b/src/wayland/meta-wayland-window-configuration.h
index 06e8b39d8..61672d5e4 100644
--- a/src/wayland/meta-wayland-window-configuration.h
+++ b/src/wayland/meta-wayland-window-configuration.h
@@ -24,6 +24,7 @@
 #include <glib.h>
 #include <stdint.h>
 
+#include "core/window-private.h"
 #include "wayland/meta-wayland-types.h"
 
 struct _MetaWaylandWindowConfiguration
@@ -41,12 +42,17 @@ struct _MetaWaylandWindowConfiguration
   gboolean has_size;
   int width;
   int height;
+
+  MetaGravity gravity;
+  MetaMoveResizeFlags flags;
 };
 
-MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new (int x,
-                                                                        int y,
-                                                                        int width,
-                                                                        int height);
+MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new (int                 x,
+                                                                        int                 y,
+                                                                        int                 width,
+                                                                        int                 height,
+                                                                        MetaMoveResizeFlags flags,
+                                                                        MetaGravity         gravity);
 
 MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new_relative (int rel_x,
                                                                                  int rel_y,
diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
index 138ac5410..e86378995 100644
--- a/src/wayland/meta-window-wayland.c
+++ b/src/wayland/meta-window-wayland.c
@@ -190,7 +190,9 @@ surface_state_changed (MetaWindow *window)
     meta_wayland_window_configuration_new (wl_window->last_sent_x,
                                            wl_window->last_sent_y,
                                            wl_window->last_sent_width,
-                                           wl_window->last_sent_height);
+                                           wl_window->last_sent_height,
+                                           META_MOVE_RESIZE_STATE_CHANGED,
+                                           META_GRAVITY_NONE);
 
   meta_window_wayland_configure (wl_window, configuration);
 }
@@ -340,7 +342,9 @@ meta_window_wayland_move_resize_internal (MetaWindow                *window,
                 meta_wayland_window_configuration_new (configured_x,
                                                        configured_y,
                                                        configured_width,
-                                                       configured_height);
+                                                       configured_height,
+                                                       flags,
+                                                       gravity);
             }
 
           meta_window_wayland_configure (wl_window, configuration);


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