aboutsummaryrefslogtreecommitdiff
path: root/client.h
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-18 01:25:53 -0600
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-18 01:27:33 -0600
commit475c13414479d1013c83309fcc4bb8a8707aa721 (patch)
tree9be3e550ad1a9c5a9727519b9db2786f9be45df2 /client.h
parent467123dc99db4a537f1043e081cc4a6db136417b (diff)
do not allow set client size less than its min size
Diffstat (limited to 'client.h')
-rw-r--r--client.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/client.h b/client.h
index 191dcc5..c59b7a9 100644
--- a/client.h
+++ b/client.h
@@ -179,3 +179,23 @@ client_surface_at(Client *c, double cx, double cy, double *sx, double *sy)
#endif
return wlr_xdg_surface_surface_at(c->surface.xdg, cx, cy, sx, sy);
}
+
+static inline void
+client_min_size(Client *c, int *width, int *height)
+{
+ struct wlr_xdg_toplevel *toplevel;
+ struct wlr_xdg_toplevel_state *state;
+#ifdef XWAYLAND
+ if (client_is_x11(c)) {
+ struct wlr_xwayland_surface_size_hints *size_hints;
+ size_hints = c->surface.xwayland->size_hints;
+ *width = size_hints->min_width;
+ *height = size_hints->min_height;
+ return;
+ }
+#endif
+ toplevel = c->surface.xdg->toplevel;
+ state = &toplevel->current;
+ *width = state->min_width;
+ *height = state->min_height;
+}