]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xdg: Handle corner case of move with pending resize correctly
authorJohn Lindgren <john@jlindgren.net>
Wed, 8 Feb 2023 21:25:16 +0000 (16:25 -0500)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 8 Feb 2023 22:22:10 +0000 (22:22 +0000)
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

index 426b9b9ec1291d6b33b5d00819cbcf2049ef4ca1..ad56e90f57623e54d112829a120f6df0221d9729 100644 (file)
--- 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);
 }