compositor: Avoid use of variable during resize

Since we only track changes to window_drag->anchor_window_pos
during move operations through on_grab_window_size_changed(), this
rectangle is in essence the same than window_drag->initial_window_pos
all the time. Just use that and move away from the anchor_window_pos
rectangle.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2942>
This commit is contained in:
Carlos Garnacho 2023-03-29 15:59:42 +02:00 committed by Marge Bot
parent 61801a713a
commit 179124dc61

View File

@ -1451,8 +1451,8 @@ update_resize (MetaWindowDrag *window_drag,
dy *= 2;
}
new_rect.width = window_drag->anchor_window_pos.width;
new_rect.height = window_drag->anchor_window_pos.height;
new_rect.width = window_drag->initial_window_pos.width;
new_rect.height = window_drag->initial_window_pos.height;
/* Don't bother doing anything if no move has been specified. (This
* happens often, even in keyboard resizing, due to the warping of the