cursor: Fix "jumping opposite edges" issue when resizing.

Commit ec68806354 ("xwayland: Honor size increments from
WM_SIZE_HINTS") adjusted only the window width/height according
to the size hints.  If resizing from the top or left edge of the
window, we also need to adjust the window position to keep the
bottom or right edge from jumping around.
This commit is contained in:
John Lindgren 2022-04-02 21:34:51 -04:00 committed by Johan Malm
parent ec68806354
commit a50d27c770
5 changed files with 52 additions and 71 deletions

View file

@ -183,19 +183,17 @@ handle_set_app_id(struct wl_listener *listener, void *data)
view_update_app_id(view);
}
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
static void
xdg_toplevel_view_configure(struct view *view, struct wlr_box geo)
{
int min_width, min_height;
view_min_size(view, &min_width, &min_height);
view_adjust_size(view, &geo.width, &geo.height);
view->pending_move_resize.update_x = geo.x != view->x;
view->pending_move_resize.update_y = geo.y != view->y;
view->pending_move_resize.x = geo.x;
view->pending_move_resize.y = geo.y;
view->pending_move_resize.width = MAX(geo.width, min_width);
view->pending_move_resize.height = MAX(geo.height, min_height);
view->pending_move_resize.width = geo.width;
view->pending_move_resize.height = geo.height;
uint32_t serial = wlr_xdg_toplevel_set_size(view->xdg_surface,
(uint32_t)geo.width, (uint32_t)geo.height);
@ -208,7 +206,6 @@ xdg_toplevel_view_configure(struct view *view, struct wlr_box geo)
damage_all_outputs(view->server);
}
}
#undef MAX
static void
xdg_toplevel_view_move(struct view *view, double x, double y)