aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-10-31 20:28:36 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-10-31 23:56:20 +1000
commit528c7495bb09e18a8b63e1c741b90f65ff5541c6 (patch)
treeb1dddeefb15f2511b33f7bed52d0df3b4110d8f8 /sway/tree/container.c
parente21a23348bd097d0b1d247a05324a8af92300851 (diff)
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) {
view->y = ws->y + (ws->height - view->height) / 2;
// If the view's border is B_NONE then these properties are ignored.
- view->border_top = view->border_bottom = true;
- view->border_left = view->border_right = true;
+ con->border_top = con->border_bottom = true;
+ con->border_left = con->border_right = true;
container_set_geometry_from_floating_view(con);
}
@@ -662,7 +662,7 @@ void container_set_floating(struct sway_container *container, bool enable) {
if (container->view) {
view_set_tiled(container->view, false);
if (container->view->using_csd) {
- container->view->border = B_CSD;
+ container->border = B_CSD;
}
}
if (old_parent) {
@@ -688,7 +688,7 @@ void container_set_floating(struct sway_container *container, bool enable) {
if (container->view) {
view_set_tiled(container->view, true);
if (container->view->using_csd) {
- container->view->border = container->view->saved_border;
+ container->border = container->saved_border;
}
}
container->is_sticky = false;
@@ -710,9 +710,9 @@ void container_set_geometry_from_floating_view(struct sway_container *con) {
size_t border_width = 0;
size_t top = 0;
- if (view->border != B_CSD) {
- border_width = view->border_thickness * (view->border != B_NONE);
- top = view->border == B_NORMAL ?
+ if (con->border != B_CSD) {
+ border_width = con->border_thickness * (con->border != B_NONE);
+ top = con->border == B_NORMAL ?
container_titlebar_height() : border_width;
}