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/desktop/output.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'sway/desktop/output.c') diff --git a/sway/desktop/output.c b/sway/desktop/output.c index c53a9c73..e8112bd9 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -160,12 +160,12 @@ void output_view_for_each_surface(struct sway_output *output, .user_iterator = iterator, .user_data = user_data, .output = output, - .ox = view->container->current.view_x - output->wlr_output->lx + .ox = view->container->current.content_x - output->wlr_output->lx - view->geometry.x, - .oy = view->container->current.view_y - output->wlr_output->ly + .oy = view->container->current.content_y - output->wlr_output->ly - view->geometry.y, - .width = view->container->current.view_width, - .height = view->container->current.view_height, + .width = view->container->current.content_width, + .height = view->container->current.content_height, .rotation = 0, // TODO }; @@ -179,12 +179,12 @@ void output_view_for_each_popup(struct sway_output *output, .user_iterator = iterator, .user_data = user_data, .output = output, - .ox = view->container->current.view_x - output->wlr_output->lx + .ox = view->container->current.content_x - output->wlr_output->lx - view->geometry.x, - .oy = view->container->current.view_y - output->wlr_output->ly + .oy = view->container->current.content_y - output->wlr_output->ly - view->geometry.y, - .width = view->container->current.view_width, - .height = view->container->current.view_height, + .width = view->container->current.content_width, + .height = view->container->current.content_height, .rotation = 0, // TODO }; @@ -473,10 +473,10 @@ void output_damage_whole_container(struct sway_output *output, struct sway_container *con) { // Pad the box by 1px, because the width is a double and might be a fraction struct wlr_box box = { - .x = con->current.con_x - output->wlr_output->lx - 1, - .y = con->current.con_y - output->wlr_output->ly - 1, - .width = con->current.con_width + 2, - .height = con->current.con_height + 2, + .x = con->current.x - output->wlr_output->lx - 1, + .y = con->current.y - output->wlr_output->ly - 1, + .width = con->current.width + 2, + .height = con->current.height + 2, }; scale_box(&box, output->wlr_output->scale); wlr_output_damage_add_box(output->damage, &box); -- cgit v1.2.3