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/xdg_shell_v6.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sway/desktop/xdg_shell_v6.c') diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 692cfbf5..4bc83b8e 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c @@ -74,8 +74,8 @@ static void popup_unconstrain(struct sway_xdg_popup_v6 *popup) { // the output box expressed in the coordinate system of the toplevel parent // of the popup struct wlr_box output_toplevel_sx_box = { - .x = output->lx - view->x, - .y = output->ly - view->y, + .x = output->lx - view->container->content_x, + .y = output->ly - view->container->content_y, .width = output->width, .height = output->height, }; @@ -283,9 +283,11 @@ static void handle_commit(struct wl_listener *listener, void *data) { } else { struct wlr_box new_geo; wlr_xdg_surface_v6_get_geometry(xdg_surface_v6, &new_geo); + struct sway_container *con = view->container; - if ((new_geo.width != view->width || new_geo.height != view->height) && - container_is_floating(view->container)) { + if ((new_geo.width != con->content_width || + new_geo.height != con->content_height) && + container_is_floating(con)) { // A floating view has unexpectedly sent a new size desktop_damage_view(view); view_update_size(view, new_geo.width, new_geo.height); -- cgit v1.2.3-54-g00ecf