aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-07-21 12:13:00 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-07-22 23:10:19 +1000
commit011d1ebfa4219eb666487529a5a5e7189c14fd40 (patch)
tree4dd3efa39573b7baa9e3965ed3b03799af849c54 /sway/tree
parent9df660ee3188386c907d8feb999636ce8d61d095 (diff)
downloadsway-011d1ebfa4219eb666487529a5a5e7189c14fd40.tar.xz
Consider view's min/max sizes when resizing
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/view.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 24594950..89150a69 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -141,6 +141,19 @@ const char *view_get_shell(struct sway_view *view) {
return "unknown";
}
+void view_get_constraints(struct sway_view *view, double *min_width,
+ double *max_width, double *min_height, double *max_height) {
+ if (view->impl->get_constraints) {
+ view->impl->get_constraints(view,
+ min_width, max_width, min_height, max_height);
+ } else {
+ *min_width = DBL_MIN;
+ *max_width = DBL_MAX;
+ *min_height = DBL_MIN;
+ *max_height = DBL_MAX;
+ }
+}
+
uint32_t view_configure(struct sway_view *view, double lx, double ly, int width,
int height) {
if (view->impl->configure) {