diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-11-17 18:32:03 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-11-17 21:29:42 +1000 |
commit | be9348d25c9556bdabb83d964a8761f920fc4a11 (patch) | |
tree | c06bde3d10e9bfea04acdd9b055cd596f13d4522 /sway/desktop/xdg_shell.c | |
parent | Merge pull request #3132 from emersion/dispatch-cursor-btn-segfault (diff) | |
download | sway-be9348d25c9556bdabb83d964a8761f920fc4a11.tar.gz sway-be9348d25c9556bdabb83d964a8761f920fc4a11.tar.zst sway-be9348d25c9556bdabb83d964a8761f920fc4a11.zip |
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.
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r-- | sway/desktop/xdg_shell.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index 0b2ebc96..801dcee0 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -75,8 +75,8 @@ static void popup_unconstrain(struct sway_xdg_popup *popup) { | |||
75 | // the output box expressed in the coordinate system of the toplevel parent | 75 | // the output box expressed in the coordinate system of the toplevel parent |
76 | // of the popup | 76 | // of the popup |
77 | struct wlr_box output_toplevel_sx_box = { | 77 | struct wlr_box output_toplevel_sx_box = { |
78 | .x = output->lx - view->x, | 78 | .x = output->lx - view->container->content_x, |
79 | .y = output->ly - view->y, | 79 | .y = output->ly - view->container->content_y, |
80 | .width = output->width, | 80 | .width = output->width, |
81 | .height = output->height, | 81 | .height = output->height, |
82 | }; | 82 | }; |
@@ -286,9 +286,11 @@ static void handle_commit(struct wl_listener *listener, void *data) { | |||
286 | } else { | 286 | } else { |
287 | struct wlr_box new_geo; | 287 | struct wlr_box new_geo; |
288 | wlr_xdg_surface_get_geometry(xdg_surface, &new_geo); | 288 | wlr_xdg_surface_get_geometry(xdg_surface, &new_geo); |
289 | struct sway_container *con = view->container; | ||
289 | 290 | ||
290 | if ((new_geo.width != view->width || new_geo.height != view->height) && | 291 | if ((new_geo.width != con->content_width || |
291 | container_is_floating(view->container)) { | 292 | new_geo.height != con->content_height) && |
293 | container_is_floating(con)) { | ||
292 | // A floating view has unexpectedly sent a new size | 294 | // A floating view has unexpectedly sent a new size |
293 | desktop_damage_view(view); | 295 | desktop_damage_view(view); |
294 | view_update_size(view, new_geo.width, new_geo.height); | 296 | view_update_size(view, new_geo.width, new_geo.height); |