summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-04-24 01:50:44 +0200
committerLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-04-25 00:00:49 +0200
commit5886ee156e948b4c7bc338d1035c2e91dc597458 (patch)
tree30ee15c9a77d7e33cad8f0325503e5a8c11f7536
parentAdd title to nested tabbed/stacked containers (diff)
downloadsway-5886ee156e948b4c7bc338d1035c2e91dc597458.tar.gz
sway-5886ee156e948b4c7bc338d1035c2e91dc597458.tar.zst
sway-5886ee156e948b4c7bc338d1035c2e91dc597458.zip
Use correct geometry for nested containers
-rw-r--r--sway/layout.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sway/layout.c b/sway/layout.c
index f9ea5cdc..fa613211 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -790,7 +790,8 @@ static void arrange_windows_r(swayc_t *container, double width, double height) {
790 y = container->y; 790 y = container->y;
791 791
792 // add gaps to top level tapped/stacked container 792 // add gaps to top level tapped/stacked container
793 if (container->layout == L_TABBED || container->layout == L_STACKED) { 793 if (container->parent->type == C_WORKSPACE &&
794 (container->layout == L_TABBED || container->layout == L_STACKED)) {
794 update_geometry(container); 795 update_geometry(container);
795 width = container->border_geometry.size.w; 796 width = container->border_geometry.size.w;
796 height = container->border_geometry.size.h; 797 height = container->border_geometry.size.h;
@@ -799,13 +800,14 @@ static void arrange_windows_r(swayc_t *container, double width, double height) {
799 } 800 }
800 801
801 // update container size if it's a child in a tabbed/stacked layout 802 // update container size if it's a child in a tabbed/stacked layout
802 if (swayc_is_tabbed_stacked(container)) { 803 if (swayc_tabbed_stacked_parent(container) != NULL) {
803 // Use parent border_geometry as a base for calculating 804 // Use parent actual_geometry as a base for calculating
804 // container geometry 805 // container geometry
805 container->width = container->parent->border_geometry.size.w; 806 container->width = container->parent->actual_geometry.size.w;
806 container->height = container->parent->border_geometry.size.h; 807 container->height = container->parent->actual_geometry.size.h;
807 container->x = container->parent->border_geometry.origin.x; 808 container->x = container->parent->actual_geometry.origin.x;
808 container->y = container->parent->border_geometry.origin.y; 809 container->y = container->parent->actual_geometry.origin.y;
810
809 update_geometry(container); 811 update_geometry(container);
810 width = container->width = container->actual_geometry.size.w; 812 width = container->width = container->actual_geometry.size.w;
811 height = container->height = container->actual_geometry.size.h; 813 height = container->height = container->actual_geometry.size.h;