aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-08-28 10:03:52 -0400
committerGitHub <noreply@github.com>2018-08-28 10:03:52 -0400
commit83230435f72dd73838bd064c22268ef4ee25e3e6 (patch)
tree7cdac6c37f6ad87c056690bdeac3d5ea0489668d /sway/tree/workspace.c
parent98ef29c22878c256dea5b4f0d1eaf556bfcb145f (diff)
parent126a82f14ff47925c7f88523ed9abe0ae9aeb7e8 (diff)
downloadsway-83230435f72dd73838bd064c22268ef4ee25e3e6.tar.xz
Merge pull request #2511 from RyanDwyer/refactor-arrange
Prepare arrange code for type safe arguments
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r--sway/tree/workspace.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index d930826e..60256336 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -694,7 +694,15 @@ void workspace_add_gaps(struct sway_container *ws) {
return;
}
- ws->current_gaps = ws->has_gaps ? ws->gaps_inner : config->gaps_inner;
+ ws->current_gaps = ws->has_gaps ? ws->gaps_outer : config->gaps_outer;
+
+ if (ws->layout == L_TABBED || ws->layout == L_STACKED) {
+ // We have to add inner gaps for this, because children of tabbed and
+ // stacked containers don't apply their own gaps - they assume the
+ // tabbed/stacked container is using gaps.
+ ws->current_gaps += ws->has_gaps ? ws->gaps_inner : config->gaps_inner;
+ }
+
ws->x += ws->current_gaps;
ws->y += ws->current_gaps;
ws->width -= 2 * ws->current_gaps;