xdg: Respect min/max size in configure

Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
Joshua Ashton 2021-10-17 18:37:55 +00:00 committed by Johan Malm
parent d9b021916a
commit 140c245880

View file

@ -171,12 +171,15 @@ handle_set_app_id(struct wl_listener *listener, void *data)
static void static void
xdg_toplevel_view_configure(struct view *view, struct wlr_box geo) 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->pending_move_resize.update_x = geo.x != view->x; view->pending_move_resize.update_x = geo.x != view->x;
view->pending_move_resize.update_y = geo.y != view->y; view->pending_move_resize.update_y = geo.y != view->y;
view->pending_move_resize.x = geo.x; view->pending_move_resize.x = geo.x;
view->pending_move_resize.y = geo.y; view->pending_move_resize.y = geo.y;
view->pending_move_resize.width = geo.width; view->pending_move_resize.width = max(geo.width, min_width);
view->pending_move_resize.height = geo.height; view->pending_move_resize.height = max(geo.height, min_height);
uint32_t serial = wlr_xdg_toplevel_set_size(view->xdg_surface, uint32_t serial = wlr_xdg_toplevel_set_size(view->xdg_surface,
(uint32_t)geo.width, (uint32_t)geo.height); (uint32_t)geo.width, (uint32_t)geo.height);