window: Make edge constraint code more readable

It relied on indices in arrays determining tile direction and
non-obvious bitmask logic to translate to _GTK_EDGE_CONSTRAINTS. Change
this to explicitly named edge constraints, and clear translation methods
that converts between mutters and GTK+s edge constraint formats.
This commit is contained in:
Jonas Ådahl
2018-10-24 14:24:22 +02:00
parent 5fc07fcc23
commit 640a04d0e4
4 changed files with 107 additions and 49 deletions

View File

@@ -222,11 +222,12 @@ struct _MetaWindow
guint saved_maximize : 1;
int tile_monitor_number;
/* 0 - top
* 1 - right
* 2 - bottom
* 3 - left */
MetaEdgeConstraint edge_constraints[4];
struct {
MetaEdgeConstraint top;
MetaEdgeConstraint right;
MetaEdgeConstraint bottom;
MetaEdgeConstraint left;
} edge_constraints;
double tile_hfraction;