]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xdg: Respect min/max size in configure
authorJoshua Ashton <joshua@froggi.es>
Sun, 17 Oct 2021 18:37:55 +0000 (18:37 +0000)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 17 Oct 2021 18:49:05 +0000 (19:49 +0100)
Signed-off-by: Joshua Ashton <joshua@froggi.es>
src/xdg.c

index 0b9deefe938cb7ea68112cf99bd29a3da5f6000c..5d1f063f0376b86762d7717f3421c3d6e66321cb 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -171,12 +171,15 @@ handle_set_app_id(struct wl_listener *listener, void *data)
 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->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 = geo.width;
-       view->pending_move_resize.height = geo.height;
+       view->pending_move_resize.width = max(geo.width, min_width);
+       view->pending_move_resize.height = max(geo.height, min_height);
 
        uint32_t serial = wlr_xdg_toplevel_set_size(view->xdg_surface,
                (uint32_t)geo.width, (uint32_t)geo.height);