aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seatop_move_tiling.c
diff options
context:
space:
mode:
authorLibravatar Pedro CĂ´rte-Real <pedro@pedrocr.net>2019-06-28 22:21:20 +0100
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-07-14 11:13:55 -0400
commite3a3917d3afb66fc8ba3eebb7aed603d3b7ce844 (patch)
tree6af979d7b1c1aeed9d88f168a9a0d1e1f7e663c0 /sway/input/seatop_move_tiling.c
parentLayout correctly with several new windows (diff)
downloadsway-e3a3917d3afb66fc8ba3eebb7aed603d3b7ce844.tar.gz
sway-e3a3917d3afb66fc8ba3eebb7aed603d3b7ce844.tar.zst
sway-e3a3917d3afb66fc8ba3eebb7aed603d3b7ce844.zip
Layout tiled using a width/height fraction
Instead of using container->width/height as both the input and output of the layout calculation have container->width_fraction/height_fraction as the share of the parent this container occupies and calculate the layout based on that. That way the container arrangement can always be recalculated even if width/height have been altered by things like fullscreen. To do this several parts are reworked: - The vertical and horizontal arrangement code is ajusted to work with fractions instead of directly with width/height - The resize code is then changed to manipulate the fractions when working on tiled containers. - Finally the places that manipulated width/height are adjusted to match. The adjusted parts are container split, swap, and the input seat code. It's possible that some parts of the code are now adjusting width and height only for those to be immediately recalculated. That's harmless and since non-tiled containers are still sized with width/height directly it may avoid breaking other corner cases. Fixes #3547 Fixes #4297
Diffstat (limited to 'sway/input/seatop_move_tiling.c')
-rw-r--r--sway/input/seatop_move_tiling.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/input/seatop_move_tiling.c b/sway/input/seatop_move_tiling.c
index e1506175..4201ae37 100644
--- a/sway/input/seatop_move_tiling.c
+++ b/sway/input/seatop_move_tiling.c
@@ -291,6 +291,8 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
291 siblings->items[1] : siblings->items[index - 1]; 291 siblings->items[1] : siblings->items[index - 1];
292 con->width = sibling->width; 292 con->width = sibling->width;
293 con->height = sibling->height; 293 con->height = sibling->height;
294 con->width_fraction = sibling->width_fraction;
295 con->height_fraction = sibling->height_fraction;
294 } 296 }
295 297
296 arrange_workspace(old_ws); 298 arrange_workspace(old_ws);