sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 5886ee156e948b4c7bc338d1035c2e91dc597458
parent 6c7ed7e7cb1f25429db05103b98e6fcee11d0362
Author: Mikkel Oscar Lyderik <mikkeloscar@gmail.com>
Date:   Sun, 24 Apr 2016 01:50:44 +0200

Use correct geometry for nested containers

Diffstat:
Msway/layout.c | 16+++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/sway/layout.c b/sway/layout.c @@ -790,7 +790,8 @@ static void arrange_windows_r(swayc_t *container, double width, double height) { y = container->y; // add gaps to top level tapped/stacked container - if (container->layout == L_TABBED || container->layout == L_STACKED) { + if (container->parent->type == C_WORKSPACE && + (container->layout == L_TABBED || container->layout == L_STACKED)) { update_geometry(container); width = container->border_geometry.size.w; height = container->border_geometry.size.h; @@ -799,13 +800,14 @@ static void arrange_windows_r(swayc_t *container, double width, double height) { } // update container size if it's a child in a tabbed/stacked layout - if (swayc_is_tabbed_stacked(container)) { - // Use parent border_geometry as a base for calculating + if (swayc_tabbed_stacked_parent(container) != NULL) { + // Use parent actual_geometry as a base for calculating // container geometry - container->width = container->parent->border_geometry.size.w; - container->height = container->parent->border_geometry.size.h; - container->x = container->parent->border_geometry.origin.x; - container->y = container->parent->border_geometry.origin.y; + container->width = container->parent->actual_geometry.size.w; + container->height = container->parent->actual_geometry.size.h; + container->x = container->parent->actual_geometry.origin.x; + container->y = container->parent->actual_geometry.origin.y; + update_geometry(container); width = container->width = container->actual_geometry.size.w; height = container->height = container->actual_geometry.size.h;