xdg: Handle corner case of move with pending resize correctly

If xdg_toplevel_view_move() is called when a resize is pending
(e.g. after xdg_toplevel_view_resize() but before handle_commit()),
the newer x/y coordinates passed to move() should take precendence
over the older pending_move_resize.x/y coordinates.

This is consistent with the logic used in xwayland.c's move().
This commit is contained in:
John Lindgren 2023-02-08 16:25:16 -05:00 committed by Johan Malm
parent cfc3c93102
commit 103a2a8f6c

View file

@ -227,6 +227,11 @@ xdg_toplevel_view_move(struct view *view, int x, int y)
{ {
view->x = x; view->x = x;
view->y = y; view->y = y;
/* override any previous pending move */
view->pending_move_resize.x = x;
view->pending_move_resize.y = y;
view_moved(view); view_moved(view);
} }