Commit 86b52477 authored by Jonas Ådahl's avatar Jonas Ådahl Committed by Florian Müllner

constraints: Only get parent rect once when placement rule constraining

We got it in a switch case, then again when finalizing. Only get it once
instead.

!496
parent 23f31e51
......@@ -821,13 +821,14 @@ constrain_custom_rule (MetaWindow *window,
adjusted_unconstrained = info->current;
parent = meta_window_get_transient_for (window);
meta_window_get_frame_rect (parent, &parent_rect);
switch (window->placement_state)
{
case META_PLACEMENT_STATE_UNCONSTRAINED:
break;
case META_PLACEMENT_STATE_CONSTRAINED:
parent = meta_window_get_transient_for (window);
meta_window_get_frame_rect (parent, &parent_rect);
adjusted_unconstrained.x =
parent_rect.x + window->constrained_placement_rule_offset_x;
adjusted_unconstrained.y =
......@@ -948,8 +949,6 @@ constrain_custom_rule (MetaWindow *window,
done:
window->placement_state = META_PLACEMENT_STATE_CONSTRAINED;
parent = meta_window_get_transient_for (window);
meta_window_get_frame_rect (parent, &parent_rect);
window->constrained_placement_rule_offset_x = info->current.x - parent_rect.x;
window->constrained_placement_rule_offset_y = info->current.y - parent_rect.y;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment