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
This commit is contained in:
Jonas Ådahl 2020-02-14 09:55:00 +01:00 committed by Carlos Garnacho
parent 0dac91cffc
commit 6c82feb1b8
3 changed files with 25 additions and 10 deletions

View File

@ -25,10 +25,12 @@
static uint32_t global_serial_counter = 0; static uint32_t global_serial_counter = 0;
MetaWaylandWindowConfiguration * MetaWaylandWindowConfiguration *
meta_wayland_window_configuration_new (int x, meta_wayland_window_configuration_new (int x,
int y, int y,
int width, int width,
int height) int height,
MetaMoveResizeFlags flags,
MetaGravity gravity)
{ {
MetaWaylandWindowConfiguration *configuration; MetaWaylandWindowConfiguration *configuration;
@ -43,6 +45,9 @@ meta_wayland_window_configuration_new (int x,
.has_size = TRUE, .has_size = TRUE,
.width = width, .width = width,
.height = height, .height = height,
.gravity = gravity,
.flags = flags,
}; };
return configuration; return configuration;

View File

@ -24,6 +24,7 @@
#include <glib.h> #include <glib.h>
#include <stdint.h> #include <stdint.h>
#include "core/window-private.h"
#include "wayland/meta-wayland-types.h" #include "wayland/meta-wayland-types.h"
struct _MetaWaylandWindowConfiguration struct _MetaWaylandWindowConfiguration
@ -41,12 +42,17 @@ struct _MetaWaylandWindowConfiguration
gboolean has_size; gboolean has_size;
int width; int width;
int height; int height;
MetaGravity gravity;
MetaMoveResizeFlags flags;
}; };
MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new (int x, MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new (int x,
int y, int y,
int width, int width,
int height); int height,
MetaMoveResizeFlags flags,
MetaGravity gravity);
MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new_relative (int rel_x, MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new_relative (int rel_x,
int rel_y, int rel_y,

View File

@ -190,7 +190,9 @@ surface_state_changed (MetaWindow *window)
meta_wayland_window_configuration_new (wl_window->last_sent_x, meta_wayland_window_configuration_new (wl_window->last_sent_x,
wl_window->last_sent_y, wl_window->last_sent_y,
wl_window->last_sent_width, 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); 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, meta_wayland_window_configuration_new (configured_x,
configured_y, configured_y,
configured_width, configured_width,
configured_height); configured_height,
flags,
gravity);
} }
meta_window_wayland_configure (wl_window, configuration); meta_window_wayland_configure (wl_window, configuration);