mirror of
https://github.com/swaywm/sway.git
synced 2026-04-27 06:46:25 -04:00
Also relayout correctly with gaps
When doing the layout of a container that includes a fullscreen child also layout new windows correctly if gaps are being used. This is done by also adjusting the saved versions x/y/width/height by the gaps so that the layout adjustments take them into account.
This commit is contained in:
parent
89ce6a80f1
commit
6fae29ee48
1 changed files with 8 additions and 0 deletions
|
|
@ -1182,9 +1182,13 @@ void container_remove_gaps(struct sway_container *c) {
|
||||||
}
|
}
|
||||||
|
|
||||||
c->width += c->current_gaps.left + c->current_gaps.right;
|
c->width += c->current_gaps.left + c->current_gaps.right;
|
||||||
|
c->saved_width += c->current_gaps.left + c->current_gaps.right;
|
||||||
c->height += c->current_gaps.top + c->current_gaps.bottom;
|
c->height += c->current_gaps.top + c->current_gaps.bottom;
|
||||||
|
c->saved_height += c->current_gaps.top + c->current_gaps.bottom;
|
||||||
c->x -= c->current_gaps.left;
|
c->x -= c->current_gaps.left;
|
||||||
|
c->saved_x -= c->current_gaps.left;
|
||||||
c->y -= c->current_gaps.top;
|
c->y -= c->current_gaps.top;
|
||||||
|
c->saved_y -= c->current_gaps.top;
|
||||||
|
|
||||||
c->current_gaps.top = 0;
|
c->current_gaps.top = 0;
|
||||||
c->current_gaps.right = 0;
|
c->current_gaps.right = 0;
|
||||||
|
|
@ -1236,9 +1240,13 @@ void container_add_gaps(struct sway_container *c) {
|
||||||
c->current_gaps.left = c->x == ws->x ? ws->gaps_inner : 0;
|
c->current_gaps.left = c->x == ws->x ? ws->gaps_inner : 0;
|
||||||
|
|
||||||
c->x += c->current_gaps.left;
|
c->x += c->current_gaps.left;
|
||||||
|
c->saved_x += c->current_gaps.left;
|
||||||
c->y += c->current_gaps.top;
|
c->y += c->current_gaps.top;
|
||||||
|
c->saved_y += c->current_gaps.top;
|
||||||
c->width -= c->current_gaps.left + c->current_gaps.right;
|
c->width -= c->current_gaps.left + c->current_gaps.right;
|
||||||
|
c->saved_width -= c->current_gaps.left + c->current_gaps.right;
|
||||||
c->height -= c->current_gaps.top + c->current_gaps.bottom;
|
c->height -= c->current_gaps.top + c->current_gaps.bottom;
|
||||||
|
c->saved_height -= c->current_gaps.top + c->current_gaps.bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum sway_container_layout container_parent_layout(struct sway_container *con) {
|
enum sway_container_layout container_parent_layout(struct sway_container *con) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue