diff --git a/src/core/constraints.c b/src/core/constraints.c index a205ea0fd..3652b3d8e 100644 --- a/src/core/constraints.c +++ b/src/core/constraints.c @@ -787,7 +787,7 @@ constrain_custom_rule (MetaWindow *window, MetaPlacementRule *placement_rule; MetaRectangle intersection; gboolean constraint_satisfied; - MetaPlacementRule *current_rule; + MetaPlacementRule current_rule; MetaWindow *parent; MetaRectangle parent_rect; @@ -820,25 +820,24 @@ constrain_custom_rule (MetaWindow *window, if (check_only) return constraint_satisfied; - current_rule = g_new0 (MetaPlacementRule, 1); - *current_rule = *placement_rule; + current_rule = *placement_rule; if (constraint_satisfied) goto done; if (info->current.width != intersection.width && - (current_rule->constraint_adjustment & + (current_rule.constraint_adjustment & META_PLACEMENT_CONSTRAINT_ADJUSTMENT_FLIP_X)) { - try_flip_window_position (window, info, current_rule, + try_flip_window_position (window, info, ¤t_rule, META_PLACEMENT_CONSTRAINT_ADJUSTMENT_FLIP_X, &info->current, &intersection); } if (info->current.height != intersection.height && - (current_rule->constraint_adjustment & + (current_rule.constraint_adjustment & META_PLACEMENT_CONSTRAINT_ADJUSTMENT_FLIP_Y)) { - try_flip_window_position (window, info, current_rule, + try_flip_window_position (window, info, ¤t_rule, META_PLACEMENT_CONSTRAINT_ADJUSTMENT_FLIP_Y, &info->current, &intersection); } @@ -852,7 +851,7 @@ constrain_custom_rule (MetaWindow *window, if (constraint_satisfied) goto done; - if (current_rule->constraint_adjustment & + if (current_rule.constraint_adjustment & META_PLACEMENT_CONSTRAINT_ADJUSTMENT_SLIDE_X) { if (info->current.x != intersection.x) @@ -860,7 +859,7 @@ constrain_custom_rule (MetaWindow *window, else if (info->current.width != intersection.width) info->current.x -= info->current.width - intersection.width; } - if (current_rule->constraint_adjustment & + if (current_rule.constraint_adjustment & META_PLACEMENT_CONSTRAINT_ADJUSTMENT_SLIDE_Y) { if (info->current.y != intersection.y) @@ -878,13 +877,13 @@ constrain_custom_rule (MetaWindow *window, if (constraint_satisfied) goto done; - if (current_rule->constraint_adjustment & + if (current_rule.constraint_adjustment & META_PLACEMENT_CONSTRAINT_ADJUSTMENT_RESIZE_X) { info->current.x = intersection.x; info->current.width = intersection.width; } - if (current_rule->constraint_adjustment & + if (current_rule.constraint_adjustment & META_PLACEMENT_CONSTRAINT_ADJUSTMENT_RESIZE_Y) { info->current.y = intersection.y;