summaryrefslogtreecommitdiff
path: root/src/core/constraints.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/constraints.c')
-rw-r--r--src/core/constraints.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/src/core/constraints.c b/src/core/constraints.c
index 558e43d31..d1a775eb2 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -1020,8 +1020,6 @@ constrain_tiling (MetaWindow *window,
gboolean check_only)
{
MetaRectangle target_size;
- MetaRectangle min_size, max_size;
- gboolean hminbad, vminbad;
gboolean horiz_equal, vert_equal;
gboolean constraint_already_satisfied;
@@ -1032,24 +1030,13 @@ constrain_tiling (MetaWindow *window,
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_tile_area_for_mode (window,
- window->tile_mode,
- window->tile_mode,
- window->tile_monitor_number,
- TRUE,
- &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;
+ target_size.x = info->work_area_monitor.x;
+ target_size.y = info->work_area_monitor.y;
+ target_size.width = info->work_area_monitor.width * window->hpercentage;
+ target_size.height = info->work_area_monitor.height * window->vpercentage;
+
+ if (window->tile_mode == META_TILE_RIGHT)
+ target_size.x += info->work_area_monitor.width - target_size.width;
/* Determine whether constraint is already satisfied; exit if it is */
horiz_equal = target_size.x == info->current.x &&
@@ -1061,13 +1048,14 @@ constrain_tiling (MetaWindow *window,
return constraint_already_satisfied;
/*** Enforce constraint ***/
+ info->current.x = target_size.x;
info->current.y = target_size.y;
+ info->current.width = target_size.width;
info->current.height = target_size.height;
return TRUE;
}
-
static gboolean
constrain_fullscreen (MetaWindow *window,
ConstraintInfo *info,