diff options
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 21b32649..18195467 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -196,22 +196,22 @@ static bool gaps_to_edge(struct sway_view *view) { | |||
196 | } | 196 | } |
197 | 197 | ||
198 | void view_autoconfigure(struct sway_view *view) { | 198 | void view_autoconfigure(struct sway_view *view) { |
199 | if (!view->container->workspace) { | 199 | struct sway_container *con = view->container; |
200 | if (!con->workspace) { | ||
200 | // Hidden in the scratchpad | 201 | // Hidden in the scratchpad |
201 | return; | 202 | return; |
202 | } | 203 | } |
203 | struct sway_output *output = view->container->workspace->output; | 204 | struct sway_output *output = con->workspace->output; |
204 | 205 | ||
205 | if (view->container->is_fullscreen) { | 206 | if (con->is_fullscreen) { |
206 | view->x = output->lx; | 207 | con->content_x = output->lx; |
207 | view->y = output->ly; | 208 | con->content_y = output->ly; |
208 | view->width = output->width; | 209 | con->content_width = output->width; |
209 | view->height = output->height; | 210 | con->content_height = output->height; |
210 | return; | 211 | return; |
211 | } | 212 | } |
212 | 213 | ||
213 | struct sway_workspace *ws = view->container->workspace; | 214 | struct sway_workspace *ws = view->container->workspace; |
214 | struct sway_container *con = view->container; | ||
215 | 215 | ||
216 | bool smart = config->hide_edge_borders == E_SMART || | 216 | bool smart = config->hide_edge_borders == E_SMART || |
217 | config->hide_edge_borders == E_SMART_NO_GAPS; | 217 | config->hide_edge_borders == E_SMART_NO_GAPS; |
@@ -289,10 +289,10 @@ void view_autoconfigure(struct sway_view *view) { | |||
289 | break; | 289 | break; |
290 | } | 290 | } |
291 | 291 | ||
292 | view->x = x; | 292 | con->content_x = x; |
293 | view->y = y; | 293 | con->content_y = y; |
294 | view->width = width; | 294 | con->content_width = width; |
295 | view->height = height; | 295 | con->content_height = height; |
296 | } | 296 | } |
297 | 297 | ||
298 | void view_set_activated(struct sway_view *view, bool activated) { | 298 | void view_set_activated(struct sway_view *view, bool activated) { |
@@ -667,11 +667,11 @@ void view_update_size(struct sway_view *view, int width, int height) { | |||
667 | "Expected a floating container")) { | 667 | "Expected a floating container")) { |
668 | return; | 668 | return; |
669 | } | 669 | } |
670 | view->width = width; | 670 | view->container->content_width = width; |
671 | view->height = height; | 671 | view->container->content_height = height; |
672 | view->container->current.view_width = width; | 672 | view->container->current.content_width = width; |
673 | view->container->current.view_height = height; | 673 | view->container->current.content_height = height; |
674 | container_set_geometry_from_floating_view(view->container); | 674 | container_set_geometry_from_content(view->container); |
675 | } | 675 | } |
676 | 676 | ||
677 | static void subsurface_get_root_coords(struct sway_view_child *child, | 677 | static void subsurface_get_root_coords(struct sway_view_child *child, |
@@ -707,7 +707,8 @@ static void view_child_damage(struct sway_view_child *child, bool whole) { | |||
707 | int sx, sy; | 707 | int sx, sy; |
708 | child->impl->get_root_coords(child, &sx, &sy); | 708 | child->impl->get_root_coords(child, &sx, &sy); |
709 | desktop_damage_surface(child->surface, | 709 | desktop_damage_surface(child->surface, |
710 | child->view->x + sx, child->view->y + sy, whole); | 710 | child->view->container->content_x + sx, |
711 | child->view->container->content_y + sy, whole); | ||
711 | } | 712 | } |
712 | 713 | ||
713 | static void view_child_handle_surface_commit(struct wl_listener *listener, | 714 | static void view_child_handle_surface_commit(struct wl_listener *listener, |