diff options
author | wil <william.barsse@gmail.com> | 2017-01-07 18:20:13 +0100 |
---|---|---|
committer | wil <william.barsse@gmail.com> | 2017-01-07 18:20:13 +0100 |
commit | 3c84250be8a31ec08f3c8057d589b5b040673b36 (patch) | |
tree | 5371c4fecc36ac7eba5d476412c527b16b4735f0 /sway/commands | |
parent | [fix] scale check to prevent un-necessary layouts was in the wrong place. (diff) | |
download | sway-3c84250be8a31ec08f3c8057d589b5b040673b36.tar.gz sway-3c84250be8a31ec08f3c8057d589b5b040673b36.tar.zst sway-3c84250be8a31ec08f3c8057d589b5b040673b36.zip |
[fix] resize should now preserve surrounding container's dimensions
- prior to this modification, the requested pixels were added/removed
to both edges of the modified container. To preserve sizes,
only half the pixels should be added/removed to each edge.
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/resize.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sway/commands/resize.c b/sway/commands/resize.c index c391945f..28b20dc4 100644 --- a/sway/commands/resize.c +++ b/sway/commands/resize.c | |||
@@ -175,15 +175,15 @@ static bool resize_tiled(int amount, bool use_width) { | |||
175 | } else { | 175 | } else { |
176 | if (use_major) { | 176 | if (use_major) { |
177 | for (int j = i; j < next_i; ++j) { | 177 | for (int j = i; j < next_i; ++j) { |
178 | recursive_resize(parent->children->items[j], pixels, | 178 | recursive_resize(parent->children->items[j], pixels / 2, |
179 | use_width ? WLC_RESIZE_EDGE_LEFT : WLC_RESIZE_EDGE_TOP); | 179 | use_width ? WLC_RESIZE_EDGE_LEFT : WLC_RESIZE_EDGE_TOP); |
180 | recursive_resize(parent->children->items[j], pixels, | 180 | recursive_resize(parent->children->items[j], pixels / 2, |
181 | use_width ? WLC_RESIZE_EDGE_RIGHT : WLC_RESIZE_EDGE_BOTTOM); | 181 | use_width ? WLC_RESIZE_EDGE_RIGHT : WLC_RESIZE_EDGE_BOTTOM); |
182 | } | 182 | } |
183 | } else { | 183 | } else { |
184 | recursive_resize(sibling, pixels, | 184 | recursive_resize(sibling, pixels / 2, |
185 | use_width ? WLC_RESIZE_EDGE_LEFT : WLC_RESIZE_EDGE_TOP); | 185 | use_width ? WLC_RESIZE_EDGE_LEFT : WLC_RESIZE_EDGE_TOP); |
186 | recursive_resize(sibling, pixels, | 186 | recursive_resize(sibling, pixels / 2, |
187 | use_width ? WLC_RESIZE_EDGE_RIGHT : WLC_RESIZE_EDGE_BOTTOM); | 187 | use_width ? WLC_RESIZE_EDGE_RIGHT : WLC_RESIZE_EDGE_BOTTOM); |
188 | } | 188 | } |
189 | } | 189 | } |