diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-26 16:32:24 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-01 23:14:58 +1000 |
commit | 70f5d6fcf3219f122077b7e8d0b43a464f4e3fd4 (patch) | |
tree | 1364ee0111dd199dd457372b539107ce47d1190f | |
parent | 3281574fa3199d649401e69e3d41493957b7d690 (diff) |
Rename container_set_geometry_from_view
-rw-r--r-- | include/sway/tree/container.h | 2 | ||||
-rw-r--r-- | sway/tree/container.c | 16 | ||||
-rw-r--r-- | sway/tree/view.c | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 4b686040..38c0f35d 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -238,7 +238,7 @@ size_t container_titlebar_height(void); void container_set_floating(struct sway_container *container, bool enable); -void container_set_geometry_from_view(struct sway_container *container); +void container_set_geometry_from_floating_view(struct sway_container *con); /** * Determine if the given container is itself floating. diff --git a/sway/tree/container.c b/sway/tree/container.c index 7928ffc3..7430aebb 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -930,23 +930,23 @@ void container_set_floating(struct sway_container *container, bool enable) { container_damage_whole(container); } -void container_set_geometry_from_view(struct sway_container *container) { - if (!sway_assert(container->type == C_VIEW, "Expected a view")) { +void container_set_geometry_from_floating_view(struct sway_container *con) { + if (!sway_assert(con->type == C_VIEW, "Expected a view")) { return; } - if (!sway_assert(container_is_floating(container), + if (!sway_assert(container_is_floating(con), "Expected a floating view")) { return; } - struct sway_view *view = container->sway_view; + struct sway_view *view = con->sway_view; size_t border_width = view->border_thickness * (view->border != B_NONE); size_t top = view->border == B_NORMAL ? container_titlebar_height() : border_width; - container->x = view->x - border_width; - container->y = view->y - top; - container->width = view->width + border_width * 2; - container->height = top + view->height + border_width; + con->x = view->x - border_width; + con->y = view->y - top; + con->width = view->width + border_width * 2; + con->height = top + view->height + border_width; } bool container_self_or_parent_floating(struct sway_container *container) { diff --git a/sway/tree/view.c b/sway/tree/view.c index 065d00db..30d5c7b4 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -567,7 +567,7 @@ void view_update_position(struct sway_view *view, double lx, double ly) { container_damage_whole(view->swayc); view->x = lx; view->y = ly; - container_set_geometry_from_view(view->swayc); + container_set_geometry_from_floating_view(view->swayc); container_damage_whole(view->swayc); } @@ -579,7 +579,7 @@ void view_update_size(struct sway_view *view, int width, int height) { view->width = width; view->height = height; if (container_is_floating(view->swayc)) { - container_set_geometry_from_view(view->swayc); + container_set_geometry_from_floating_view(view->swayc); } container_damage_whole(view->swayc); } |