diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/desktop/render.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 42d62b90..8f1e9c52 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -32,7 +32,7 @@ | |||
32 | struct render_data { | 32 | struct render_data { |
33 | pixman_region32_t *damage; | 33 | pixman_region32_t *damage; |
34 | float alpha; | 34 | float alpha; |
35 | struct sway_container *container; | 35 | struct wlr_box *clip_box; |
36 | }; | 36 | }; |
37 | 37 | ||
38 | /** | 38 | /** |
@@ -157,10 +157,10 @@ static void render_surface_iterator(struct sway_output *output, struct sway_view | |||
157 | wlr_output->transform_matrix); | 157 | wlr_output->transform_matrix); |
158 | 158 | ||
159 | struct wlr_box dst_box = *_box; | 159 | struct wlr_box dst_box = *_box; |
160 | struct sway_container *container = data->container; | 160 | struct wlr_box *clip_box = data->clip_box; |
161 | if (container != NULL) { | 161 | if (clip_box != NULL) { |
162 | dst_box.width = fmin(dst_box.width, container->current.content_width); | 162 | dst_box.width = fmin(dst_box.width, clip_box->width); |
163 | dst_box.height = fmin(dst_box.height, container->current.content_height); | 163 | dst_box.height = fmin(dst_box.height, clip_box->height); |
164 | } | 164 | } |
165 | scale_box(&dst_box, wlr_output->scale); | 165 | scale_box(&dst_box, wlr_output->scale); |
166 | 166 | ||
@@ -262,8 +262,13 @@ static void render_view_toplevels(struct sway_view *view, | |||
262 | .damage = damage, | 262 | .damage = damage, |
263 | .alpha = alpha, | 263 | .alpha = alpha, |
264 | }; | 264 | }; |
265 | struct wlr_box clip_box; | ||
265 | if (!container_is_current_floating(view->container)) { | 266 | if (!container_is_current_floating(view->container)) { |
266 | data.container = view->container; | 267 | // As we pass the geometry offsets to the surface iterator, we will |
268 | // need to account for the offsets in the clip dimensions. | ||
269 | clip_box.width = view->container->current.content_width + view->geometry.x; | ||
270 | clip_box.height = view->container->current.content_height + view->geometry.y; | ||
271 | data.clip_box = &clip_box; | ||
267 | } | 272 | } |
268 | // Render all toplevels without descending into popups | 273 | // Render all toplevels without descending into popups |
269 | double ox = view->container->surface_x - | 274 | double ox = view->container->surface_x - |
@@ -329,10 +334,10 @@ static void render_saved_view(struct sway_view *view, | |||
329 | if (!floating) { | 334 | if (!floating) { |
330 | dst_box.width = fmin(dst_box.width, | 335 | dst_box.width = fmin(dst_box.width, |
331 | view->container->current.content_width - | 336 | view->container->current.content_width - |
332 | (saved_buf->x - view->container->current.content_x)); | 337 | (saved_buf->x - view->container->current.content_x) + view->saved_geometry.x); |
333 | dst_box.height = fmin(dst_box.height, | 338 | dst_box.height = fmin(dst_box.height, |
334 | view->container->current.content_height - | 339 | view->container->current.content_height - |
335 | (saved_buf->y - view->container->current.content_y)); | 340 | (saved_buf->y - view->container->current.content_y) + view->saved_geometry.y); |
336 | } | 341 | } |
337 | scale_box(&dst_box, wlr_output->scale); | 342 | scale_box(&dst_box, wlr_output->scale); |
338 | 343 | ||