aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-31 20:28:36 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-31 23:56:20 +1000
commit528c7495bb09e18a8b63e1c741b90f65ff5541c6 (patch)
treeb1dddeefb15f2511b33f7bed52d0df3b4110d8f8 /sway/tree/container.c
parentMerge pull request #3031 from atomnuker/master (diff)
downloadsway-528c7495bb09e18a8b63e1c741b90f65ff5541c6.tar.gz
sway-528c7495bb09e18a8b63e1c741b90f65ff5541c6.tar.zst
sway-528c7495bb09e18a8b63e1c741b90f65ff5541c6.zip
Move view border properties to container struct
This will be needed to implement layout saving and restoring, as we need to be able to configure borders on a placeholder container which has no view.
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 8ab6ebf8..322f2f67 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -639,8 +639,8 @@ void container_init_floating(struct sway_container *con) {
639 view->y = ws->y + (ws->height - view->height) / 2; 639 view->y = ws->y + (ws->height - view->height) / 2;
640 640
641 // If the view's border is B_NONE then these properties are ignored. 641 // If the view's border is B_NONE then these properties are ignored.
642 view->border_top = view->border_bottom = true; 642 con->border_top = con->border_bottom = true;
643 view->border_left = view->border_right = true; 643 con->border_left = con->border_right = true;
644 644
645 container_set_geometry_from_floating_view(con); 645 container_set_geometry_from_floating_view(con);
646 } 646 }
@@ -662,7 +662,7 @@ void container_set_floating(struct sway_container *container, bool enable) {
662 if (container->view) { 662 if (container->view) {
663 view_set_tiled(container->view, false); 663 view_set_tiled(container->view, false);
664 if (container->view->using_csd) { 664 if (container->view->using_csd) {
665 container->view->border = B_CSD; 665 container->border = B_CSD;
666 } 666 }
667 } 667 }
668 if (old_parent) { 668 if (old_parent) {
@@ -688,7 +688,7 @@ void container_set_floating(struct sway_container *container, bool enable) {
688 if (container->view) { 688 if (container->view) {
689 view_set_tiled(container->view, true); 689 view_set_tiled(container->view, true);
690 if (container->view->using_csd) { 690 if (container->view->using_csd) {
691 container->view->border = container->view->saved_border; 691 container->border = container->saved_border;
692 } 692 }
693 } 693 }
694 container->is_sticky = false; 694 container->is_sticky = false;
@@ -710,9 +710,9 @@ void container_set_geometry_from_floating_view(struct sway_container *con) {
710 size_t border_width = 0; 710 size_t border_width = 0;
711 size_t top = 0; 711 size_t top = 0;
712 712
713 if (view->border != B_CSD) { 713 if (con->border != B_CSD) {
714 border_width = view->border_thickness * (view->border != B_NONE); 714 border_width = con->border_thickness * (con->border != B_NONE);
715 top = view->border == B_NORMAL ? 715 top = con->border == B_NORMAL ?
716 container_titlebar_height() : border_width; 716 container_titlebar_height() : border_width;
717 } 717 }
718 718