From be9348d25c9556bdabb83d964a8761f920fc4a11 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 17 Nov 2018 18:32:03 +1000 Subject: Move view {x,y,width,height} into container struct This renames/moves the following properties: * sway_view.{x,y,width,height} -> sway_container.content_{x,y,width,height} * This is required to support placeholder containers as they don't have a view. * sway_container_state.view_{x,y,width,height} -> sway_container_state.content_{x,y,width,height} * To remain consistent with the above. * sway_container_state.con_{x,y,width,height} -> sway_container_state.{x,y,width,height} * The con prefix was there to give it contrast from the view properties, and is no longer useful. The function container_set_geometry_from_floating_view has also been renamed to container_set_geometry_from_content. --- sway/commands/border.c | 2 +- sway/commands/resize.c | 22 ++++++++-------------- 2 files changed, 9 insertions(+), 15 deletions(-) (limited to 'sway/commands') diff --git a/sway/commands/border.c b/sway/commands/border.c index b6eab550..d51741d2 100644 --- a/sway/commands/border.c +++ b/sway/commands/border.c @@ -93,7 +93,7 @@ struct cmd_results *cmd_border(int argc, char **argv) { } if (container_is_floating(container)) { - container_set_geometry_from_floating_view(container); + container_set_geometry_from_content(container); } arrange_container(container); diff --git a/sway/commands/resize.c b/sway/commands/resize.c index 94ffbbe1..e876f48a 100644 --- a/sway/commands/resize.c +++ b/sway/commands/resize.c @@ -404,13 +404,10 @@ static struct cmd_results *resize_adjust_floating(enum resize_axis axis, con->width += grow_width; con->height += grow_height; - if (con->view) { - struct sway_view *view = con->view; - view->x += grow_x; - view->y += grow_y; - view->width += grow_width; - view->height += grow_height; - } + con->content_x += grow_x; + con->content_y += grow_y; + con->content_width += grow_width; + con->content_height += grow_height; arrange_container(con); @@ -546,13 +543,10 @@ static struct cmd_results *resize_set_floating(struct sway_container *con, } } - if (con->view) { - struct sway_view *view = con->view; - view->x -= grow_width / 2; - view->y -= grow_height / 2; - view->width += grow_width; - view->height += grow_height; - } + con->content_x -= grow_width / 2; + con->content_y -= grow_height / 2; + con->content_width += grow_width; + con->content_height += grow_height; arrange_container(con); -- cgit v1.2.3