aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar KoffeinFlummi <koffeinflummi@gmail.com>2015-08-20 08:46:06 +0200
committerLibravatar KoffeinFlummi <koffeinflummi@gmail.com>2015-08-20 08:47:51 +0200
commit3c124d9e7d56559ff6c82ac313cb7ee065bc839f (patch)
tree5819c5982ee8604e1566c0960d939c2df687e665 /sway
parentDeal with more xkb bullshit (diff)
downloadsway-3c124d9e7d56559ff6c82ac313cb7ee065bc839f.tar.gz
sway-3c124d9e7d56559ff6c82ac313cb7ee065bc839f.tar.zst
sway-3c124d9e7d56559ff6c82ac313cb7ee065bc839f.zip
Change gap behaviour to more closely match i3-gaps
Previously, when only using inner gaps, the gap between a window at the edge of the output was only half the size of the gaps between views. Additionally, the gaps between the actual windows was twice as wide as it was on i3-gaps.
Diffstat (limited to 'sway')
-rw-r--r--sway/container.c2
-rw-r--r--sway/layout.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/sway/container.c b/sway/container.c
index 9c6b78e9..dee4028d 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -67,7 +67,7 @@ swayc_t *new_output(wlc_handle handle) {
67 output->height = size->h; 67 output->height = size->h;
68 output->handle = handle; 68 output->handle = handle;
69 output->name = name ? strdup(name) : NULL; 69 output->name = name ? strdup(name) : NULL;
70 output->gaps = config->gaps_outer; 70 output->gaps = config->gaps_outer + config->gaps_inner / 2;
71 71
72 add_child(&root_container, output); 72 add_child(&root_container, output);
73 73
diff --git a/sway/layout.c b/sway/layout.c
index eb8391ce..e628c5ed 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -152,12 +152,12 @@ void arrange_windows(swayc_t *container, int width, int height) {
152 { 152 {
153 struct wlc_geometry geometry = { 153 struct wlc_geometry geometry = {
154 .origin = { 154 .origin = {
155 .x = container->x + container->gaps, 155 .x = container->x + container->gaps / 2,
156 .y = container->y + container->gaps 156 .y = container->y + container->gaps / 2
157 }, 157 },
158 .size = { 158 .size = {
159 .w = width - container->gaps * 2, 159 .w = width - container->gaps,
160 .h = height - container->gaps * 2 160 .h = height - container->gaps
161 } 161 }
162 }; 162 };
163 if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) { 163 if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) {