From 103a2a8f6c38a8eb664160e369477cad98003598 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Wed, 8 Feb 2023 16:25:16 -0500 Subject: [PATCH] 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(). --- src/xdg.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xdg.c b/src/xdg.c index 426b9b9e..ad56e90f 100644 --- a/src/xdg.c +++ b/src/xdg.c @@ -227,6 +227,11 @@ xdg_toplevel_view_move(struct view *view, int x, int y) { view->x = x; view->y = y; + + /* override any previous pending move */ + view->pending_move_resize.x = x; + view->pending_move_resize.y = y; + view_moved(view); }