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;
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;

View File

@ -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,

View File

@ -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);