mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Rename container_set_geometry_from_view
This commit is contained in:
parent
3281574fa3
commit
70f5d6fcf3
3 changed files with 11 additions and 11 deletions
|
@ -238,7 +238,7 @@ size_t container_titlebar_height(void);
|
||||||
|
|
||||||
void container_set_floating(struct sway_container *container, bool enable);
|
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.
|
* Determine if the given container is itself floating.
|
||||||
|
|
|
@ -930,23 +930,23 @@ void container_set_floating(struct sway_container *container, bool enable) {
|
||||||
container_damage_whole(container);
|
container_damage_whole(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
void container_set_geometry_from_view(struct sway_container *container) {
|
void container_set_geometry_from_floating_view(struct sway_container *con) {
|
||||||
if (!sway_assert(container->type == C_VIEW, "Expected a view")) {
|
if (!sway_assert(con->type == C_VIEW, "Expected a view")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!sway_assert(container_is_floating(container),
|
if (!sway_assert(container_is_floating(con),
|
||||||
"Expected a floating view")) {
|
"Expected a floating view")) {
|
||||||
return;
|
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 border_width = view->border_thickness * (view->border != B_NONE);
|
||||||
size_t top =
|
size_t top =
|
||||||
view->border == B_NORMAL ? container_titlebar_height() : border_width;
|
view->border == B_NORMAL ? container_titlebar_height() : border_width;
|
||||||
|
|
||||||
container->x = view->x - border_width;
|
con->x = view->x - border_width;
|
||||||
container->y = view->y - top;
|
con->y = view->y - top;
|
||||||
container->width = view->width + border_width * 2;
|
con->width = view->width + border_width * 2;
|
||||||
container->height = top + view->height + border_width;
|
con->height = top + view->height + border_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool container_self_or_parent_floating(struct sway_container *container) {
|
bool container_self_or_parent_floating(struct sway_container *container) {
|
||||||
|
|
|
@ -567,7 +567,7 @@ void view_update_position(struct sway_view *view, double lx, double ly) {
|
||||||
container_damage_whole(view->swayc);
|
container_damage_whole(view->swayc);
|
||||||
view->x = lx;
|
view->x = lx;
|
||||||
view->y = ly;
|
view->y = ly;
|
||||||
container_set_geometry_from_view(view->swayc);
|
container_set_geometry_from_floating_view(view->swayc);
|
||||||
container_damage_whole(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->width = width;
|
||||||
view->height = height;
|
view->height = height;
|
||||||
if (container_is_floating(view->swayc)) {
|
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);
|
container_damage_whole(view->swayc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue