aboutsummaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
authorDenis Doria <denisdoria@gmail.com>2016-05-31 14:59:33 +0200
committerDenis Doria <denisdoria@gmail.com>2016-05-31 14:59:33 +0200
commitf1d5b89d3eabf0af267ed4a385079d616a82d2aa (patch)
treedc5017d0adbd1168c936d66faf34b82c2eb010b3 /sway/container.c
parent9d7d73df7f7888a3ea8420662fa5aa2ef6e3bd82 (diff)
Initial work for floating view with sane values
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sway/container.c b/sway/container.c
index 4883a648..e00d2d7e 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -328,6 +328,31 @@ swayc_t *new_floating_view(wlc_handle handle) {
return view;
}
+void floating_view_sane_size(swayc_t *view) {
+ if (config->floating_minimum_height != -1 &&
+ view->desired_height < config->floating_minimum_height) {
+ view->desired_height = config->floating_minimum_height;
+ }
+ if (config->floating_minimum_width != -1 &&
+ view->desired_width < config->floating_minimum_width) {
+ view->desired_width = config->floating_minimum_width;
+ }
+
+ if (config->floating_maximum_height != -1 &&
+ view->desired_height > config->floating_maximum_height) {
+ view->desired_height = config->floating_maximum_height;
+ }
+ if (config->floating_maximum_width != -1 &&
+ view->desired_width > config->floating_maximum_width) {
+ view->desired_width = config->floating_maximum_width;
+ }
+ sway_log(L_DEBUG, "Sane values for view to %d x %d @ %.f, %.f",
+ view->desired_width, view->desired_height, view->x, view->y);
+
+ return;
+}
+
+
// Destroy container
swayc_t *destroy_output(swayc_t *output) {