aboutsummaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-18 18:07:51 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-18 18:07:51 -0400
commit446d593b4ca5cf4ea5bbf9eaafe8a6f3521b4189 (patch)
tree97279d1259c4e049a74af4efa3e4b2334a6cae74 /sway/container.c
parent8e201091a52a74d87db18c18a21fc39aedb95eb2 (diff)
parentc75d5ceba475e3c6d1fae475c610c53909a83a29 (diff)
Merge pull request #73 from KoffeinFlummi/gaps
Add support for gaps option
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sway/container.c b/sway/container.c
index 62c5bda0..06111674 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -63,8 +63,10 @@ swayc_t *new_output(wlc_handle handle) {
sway_log(L_DEBUG, "Added output %lu:%s", handle, name);
swayc_t *output = new_swayc(C_OUTPUT);
- output->width = size->w;
- output->height = size->h;
+ output->x = (config->gaps_outer + config->gaps_inner) / 2;
+ output->y = (config->gaps_outer + config->gaps_inner) / 2;
+ output->width = size->w - (config->gaps_outer + config->gaps_inner);
+ output->height = size->h - (config->gaps_outer + config->gaps_inner);
output->handle = handle;
output->name = name ? strdup(name) : NULL;
@@ -105,6 +107,8 @@ swayc_t *new_workspace(swayc_t *output, const char *name) {
swayc_t *workspace = new_swayc(C_WORKSPACE);
workspace->layout = L_HORIZ; // TODO: default layout
+ workspace->x = output->x;
+ workspace->y = output->y;
workspace->width = output->width;
workspace->height = output->height;
workspace->name = strdup(name);
@@ -167,6 +171,8 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle) {
view->visible = true;
view->is_focused = true;
+ view->gaps = config->gaps_inner;
+
view->desired_width = -1;
view->desired_height = -1;