aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/render.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r--sway/desktop/render.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 608f3ee9..58e263e2 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -32,7 +32,7 @@
32struct render_data { 32struct 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/**
@@ -160,10 +160,10 @@ static void render_surface_iterator(struct sway_output *output, struct sway_view
160 wlr_output->transform_matrix); 160 wlr_output->transform_matrix);
161 161
162 struct wlr_box dst_box = *_box; 162 struct wlr_box dst_box = *_box;
163 struct sway_container *container = data->container; 163 struct wlr_box *clip_box = data->clip_box;
164 if (container != NULL) { 164 if (clip_box != NULL) {
165 dst_box.width = fmin(dst_box.width, container->current.content_width); 165 dst_box.width = fmin(dst_box.width, clip_box->width);
166 dst_box.height = fmin(dst_box.height, container->current.content_height); 166 dst_box.height = fmin(dst_box.height, clip_box->height);
167 } 167 }
168 scale_box(&dst_box, wlr_output->scale); 168 scale_box(&dst_box, wlr_output->scale);
169 169
@@ -265,8 +265,13 @@ static void render_view_toplevels(struct sway_view *view,
265 .damage = damage, 265 .damage = damage,
266 .alpha = alpha, 266 .alpha = alpha,
267 }; 267 };
268 struct wlr_box clip_box;
268 if (!container_is_current_floating(view->container)) { 269 if (!container_is_current_floating(view->container)) {
269 data.container = view->container; 270 // As we pass the geometry offsets to the surface iterator, we will
271 // need to account for the offsets in the clip dimensions.
272 clip_box.width = view->container->current.content_width + view->geometry.x;
273 clip_box.height = view->container->current.content_height + view->geometry.y;
274 data.clip_box = &clip_box;
270 } 275 }
271 // Render all toplevels without descending into popups 276 // Render all toplevels without descending into popups
272 double ox = view->container->surface_x - 277 double ox = view->container->surface_x -
@@ -332,10 +337,10 @@ static void render_saved_view(struct sway_view *view,
332 if (!floating) { 337 if (!floating) {
333 dst_box.width = fmin(dst_box.width, 338 dst_box.width = fmin(dst_box.width,
334 view->container->current.content_width - 339 view->container->current.content_width -
335 (saved_buf->x - view->container->current.content_x)); 340 (saved_buf->x - view->container->current.content_x) + view->saved_geometry.x);
336 dst_box.height = fmin(dst_box.height, 341 dst_box.height = fmin(dst_box.height,
337 view->container->current.content_height - 342 view->container->current.content_height -
338 (saved_buf->y - view->container->current.content_y)); 343 (saved_buf->y - view->container->current.content_y) + view->saved_geometry.y);
339 } 344 }
340 scale_box(&dst_box, wlr_output->scale); 345 scale_box(&dst_box, wlr_output->scale);
341 346