summaryrefslogtreecommitdiffstats
path: root/sway/layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 02c92026..7cb9186a 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -4,6 +4,7 @@
4#include "layout.h" 4#include "layout.h"
5#include "log.h" 5#include "log.h"
6#include "list.h" 6#include "list.h"
7#include "config.h"
7#include "container.h" 8#include "container.h"
8#include "workspace.h" 9#include "workspace.h"
9#include "focus.h" 10#include "focus.h"
@@ -123,11 +124,11 @@ void arrange_windows(swayc_t *container, int width, int height) {
123 // y -= container->y; 124 // y -= container->y;
124 for (i = 0; i < container->children->length; ++i) { 125 for (i = 0; i < container->children->length; ++i) {
125 swayc_t *child = container->children->items[i]; 126 swayc_t *child = container->children->items[i];
126 sway_log(L_DEBUG, "Arranging workspace #%d", i); 127 child->x = x + container->gaps;
127 child->x = x; 128 child->y = y + container->gaps;
128 child->y = y; 129 child->width = width - container->gaps * 2;
129 child->width = width; 130 child->height = height - container->gaps * 2;
130 child->height = height; 131 sway_log(L_DEBUG, "Arranging workspace #%d at %d, %d", i, child->x, child->y);
131 arrange_windows(child, -1, -1); 132 arrange_windows(child, -1, -1);
132 } 133 }
133 return; 134 return;
@@ -135,12 +136,12 @@ void arrange_windows(swayc_t *container, int width, int height) {
135 { 136 {
136 struct wlc_geometry geometry = { 137 struct wlc_geometry geometry = {
137 .origin = { 138 .origin = {
138 .x = container->x + container->gaps / 2, 139 .x = container->x + container->gaps,
139 .y = container->y + container->gaps / 2 140 .y = container->y + container->gaps
140 }, 141 },
141 .size = { 142 .size = {
142 .w = width - container->gaps, 143 .w = width - container->gaps * 2,
143 .h = height - container->gaps 144 .h = height - container->gaps * 2
144 } 145 }
145 }; 146 };
146 if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) { 147 if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) {
@@ -148,10 +149,10 @@ void arrange_windows(swayc_t *container, int width, int height) {
148 while (parent->type != C_OUTPUT) { 149 while (parent->type != C_OUTPUT) {
149 parent = parent->parent; 150 parent = parent->parent;
150 } 151 }
151 geometry.origin.x = container->gaps / 2; 152 geometry.origin.x = 0;
152 geometry.origin.y = container->gaps / 2; 153 geometry.origin.y = 0;
153 geometry.size.w = parent->width - container->gaps; 154 geometry.size.w = parent->width;
154 geometry.size.h = parent->height - container->gaps; 155 geometry.size.h = parent->height;
155 wlc_view_set_geometry(container->handle, 0, &geometry); 156 wlc_view_set_geometry(container->handle, 0, &geometry);
156 wlc_view_bring_to_front(container->handle); 157 wlc_view_bring_to_front(container->handle);
157 } else { 158 } else {