[mutter/wip/gbsneto/tiling-improvements: 3/9] constaints: Remove tiling constraint
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/gbsneto/tiling-improvements: 3/9] constaints: Remove tiling constraint
- Date: Fri, 16 Jun 2017 00:46:15 +0000 (UTC)
commit b37935dbaa20f90a9aaf5dce316d268bc89ac426
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Jun 14 20:21:21 2017 -0300
constaints: Remove tiling constraint
When it wasn't possible to resize windows when
they were tiled, it made sense to have a constraint
ensuring the tiled window has the correct width.
Now, however, it is possible to freely resize tiled
windows, and the constraint is calling unecessarily
meta_window_get_current_tile_area(). This will bite
us in the future.
This patch removes the tiling constraint.
https://bugzilla.gnome.org/show_bug.cgi?id=645153
src/core/constraints.c | 58 ------------------------------------------------
1 files changed, 0 insertions(+), 58 deletions(-)
---
diff --git a/src/core/constraints.c b/src/core/constraints.c
index 14044a9..637ec39 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -100,7 +100,6 @@ typedef enum
PRIORITY_ENTIRELY_VISIBLE_ON_WORKAREA = 1,
PRIORITY_SIZE_HINTS_INCREMENTS = 1,
PRIORITY_MAXIMIZATION = 2,
- PRIORITY_TILING = 2,
PRIORITY_FULLSCREEN = 2,
PRIORITY_SIZE_HINTS_LIMITS = 3,
PRIORITY_TITLEBAR_VISIBLE = 4,
@@ -160,10 +159,6 @@ static gboolean constrain_maximization (MetaWindow *window,
ConstraintInfo *info,
ConstraintPriority priority,
gboolean check_only);
-static gboolean constrain_tiling (MetaWindow *window,
- ConstraintInfo *info,
- ConstraintPriority priority,
- gboolean check_only);
static gboolean constrain_fullscreen (MetaWindow *window,
ConstraintInfo *info,
ConstraintPriority priority,
@@ -222,7 +217,6 @@ static const Constraint all_constraints[] = {
{constrain_custom_rule, "constrain_custom_rule"},
{constrain_modal_dialog, "constrain_modal_dialog"},
{constrain_maximization, "constrain_maximization"},
- {constrain_tiling, "constrain_tiling"},
{constrain_fullscreen, "constrain_fullscreen"},
{constrain_size_increments, "constrain_size_increments"},
{constrain_size_limits, "constrain_size_limits"},
@@ -1009,58 +1003,6 @@ constrain_maximization (MetaWindow *window,
}
static gboolean
-constrain_tiling (MetaWindow *window,
- ConstraintInfo *info,
- ConstraintPriority priority,
- gboolean check_only)
-{
- MetaRectangle target_size;
- MetaRectangle min_size, max_size;
- gboolean hminbad, vminbad;
- gboolean horiz_equal, vert_equal;
- gboolean constraint_already_satisfied;
-
- if (priority > PRIORITY_TILING)
- return TRUE;
-
- /* Determine whether constraint applies; exit if it doesn't */
- if (!META_WINDOW_TILED_SIDE_BY_SIDE (window))
- return TRUE;
-
- /* Calculate target_size - as the tile previews need this as well, we
- * use an external function for the actual calculation
- */
- meta_window_get_current_tile_area (window, &target_size);
-
- /* Check min size constraints; max size constraints are ignored as for
- * maximized windows.
- */
- get_size_limits (window, &min_size, &max_size);
- hminbad = target_size.width < min_size.width;
- vminbad = target_size.height < min_size.height;
- if (hminbad || vminbad)
- return TRUE;
-
- /* Determine whether constraint is already satisfied; exit if it is */
- horiz_equal = target_size.x == info->current.x &&
- target_size.width == info->current.width;
- vert_equal = target_size.y == info->current.y &&
- target_size.height == info->current.height;
- constraint_already_satisfied = horiz_equal && vert_equal;
- if (check_only || constraint_already_satisfied)
- return constraint_already_satisfied;
-
- /*** Enforce constraint ***/
- info->current.x = target_size.x;
- info->current.width = target_size.width;
- info->current.y = target_size.y;
- info->current.height = target_size.height;
-
- return TRUE;
-}
-
-
-static gboolean
constrain_fullscreen (MetaWindow *window,
ConstraintInfo *info,
ConstraintPriority priority,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]