diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-28 23:53:51 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-28 23:53:51 +1000 |
commit | 126a82f14ff47925c7f88523ed9abe0ae9aeb7e8 (patch) | |
tree | 7cdac6c37f6ad87c056690bdeac3d5ea0489668d /sway/tree/container.c | |
parent | Prepare arrange code for type safe arguments (diff) | |
download | sway-126a82f14ff47925c7f88523ed9abe0ae9aeb7e8.tar.gz sway-126a82f14ff47925c7f88523ed9abe0ae9aeb7e8.tar.zst sway-126a82f14ff47925c7f88523ed9abe0ae9aeb7e8.zip |
Fix gaps issues
* In layout command, arrange parent of parent - not sure why this is
needed but it is
* Remove gap adjustment when rendering
* Workspace should use outer gaps, not inner
* Add exceptions for tabbed and stacked containers
* Don't mess with gap state when splitting a container
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 1b193944..ee019098 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -1159,7 +1159,17 @@ void container_add_gaps(struct sway_container *c) { | |||
1159 | "Expected a container or view")) { | 1159 | "Expected a container or view")) { |
1160 | return; | 1160 | return; |
1161 | } | 1161 | } |
1162 | if (c->current_gaps > 0 || c->type != C_VIEW) { | 1162 | if (c->current_gaps > 0) { |
1163 | return; | ||
1164 | } | ||
1165 | // Linear containers don't have gaps because it'd create double gaps | ||
1166 | if (c->type == C_CONTAINER && | ||
1167 | c->layout != L_TABBED && c->layout != L_STACKED) { | ||
1168 | return; | ||
1169 | } | ||
1170 | // Children of tabbed/stacked containers re-use the gaps of the container | ||
1171 | enum sway_container_layout layout = c->parent->layout; | ||
1172 | if (layout == L_TABBED || layout == L_STACKED) { | ||
1163 | return; | 1173 | return; |
1164 | } | 1174 | } |
1165 | 1175 | ||
@@ -1355,20 +1365,16 @@ struct sway_container *container_split(struct sway_container *child, | |||
1355 | 1365 | ||
1356 | wlr_log(WLR_DEBUG, "creating container %p around %p", cont, child); | 1366 | wlr_log(WLR_DEBUG, "creating container %p around %p", cont, child); |
1357 | 1367 | ||
1358 | child->type == C_WORKSPACE ? workspace_remove_gaps(child) | ||
1359 | : container_remove_gaps(child); | ||
1360 | |||
1361 | cont->prev_split_layout = L_NONE; | 1368 | cont->prev_split_layout = L_NONE; |
1362 | cont->width = child->width; | 1369 | cont->width = child->width; |
1363 | cont->height = child->height; | 1370 | cont->height = child->height; |
1364 | cont->x = child->x; | 1371 | cont->x = child->x; |
1365 | cont->y = child->y; | 1372 | cont->y = child->y; |
1373 | cont->current_gaps = child->current_gaps; | ||
1366 | 1374 | ||
1367 | struct sway_seat *seat = input_manager_get_default_seat(input_manager); | 1375 | struct sway_seat *seat = input_manager_get_default_seat(input_manager); |
1368 | bool set_focus = (seat_get_focus(seat) == child); | 1376 | bool set_focus = (seat_get_focus(seat) == child); |
1369 | 1377 | ||
1370 | container_add_gaps(cont); | ||
1371 | |||
1372 | if (child->type == C_WORKSPACE) { | 1378 | if (child->type == C_WORKSPACE) { |
1373 | struct sway_container *workspace = child; | 1379 | struct sway_container *workspace = child; |
1374 | while (workspace->children->length) { | 1380 | while (workspace->children->length) { |