aboutsummaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
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;