window: Track edge constraints

GTK has the ability to handle client-decorated windows
in such a way that the behavior of these windows must
match the behavior of the current window manager.

In Mutter, windows can be tiled horizontally (and, in
the future, vertically as well), which comes with a few
requirements that the toolkit must supply. Tiled windows
have their borders' behavior changed depending on the
tiled position, and the toolkit must be aware of this
information in order to properly match the window manager
behavior.

In order to provide toolkits with more precise and general
data regarding resizable and constrained edges, this patch
makes MetaWindow track its own edge constraints.

This will later be used by the backends to send information
to the toolkit.

https://bugzilla.gnome.org/show_bug.cgi?id=751857
This commit is contained in:
Georges Basile Stavracas Neto
2017-08-17 00:43:21 -03:00
parent a1c39e142d
commit a5f4ffa58c
2 changed files with 82 additions and 1 deletions

View File

@@ -129,6 +129,13 @@ typedef struct _MetaPlacementRule
int height;
} MetaPlacementRule;
typedef enum
{
META_EDGE_CONSTRAINT_NONE = 0,
META_EDGE_CONSTRAINT_WINDOW = 1,
META_EDGE_CONSTRAINT_MONITOR = 2,
} MetaEdgeConstraint;
struct _MetaWindow
{
GObject parent_instance;
@@ -205,10 +212,17 @@ struct _MetaWindow
* that to toggle between normal/tiled or maximized/tiled states. */
guint saved_maximize : 1;
int tile_monitor_number;
int preferred_output_winsys_id;
/* 0 - top
* 1 - right
* 2 - bottom
* 3 - left */
MetaEdgeConstraint edge_constraints[4];
double tile_hfraction;
int preferred_output_winsys_id;
/* Whether we're shaded */
guint shaded : 1;