Add support for gaps option

This commit is contained in:
KoffeinFlummi 2015-08-18 23:53:57 +02:00
parent 2139001c9f
commit 4c688cba4e
6 changed files with 63 additions and 10 deletions

View file

@ -43,8 +43,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;
@ -81,6 +83,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);
@ -143,6 +147,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;