aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/render.c
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2021-02-08 00:51:10 +0100
committerSimon Ser <contact@emersion.fr>2021-02-09 09:37:10 +0100
commitcf1e3be22813d343ec177d48a926d7d9104230dd (patch)
treee2c47101f4db1aa439951dbefa10ea0dcb006881 /sway/desktop/render.c
parent63420a2caa728dd52121fc4b9a3d6d7a4f2c3444 (diff)
view: Save surface x and y on saved buffers
We need to use surface_x and surface_y when rendering and damaging saved buffers as these compensate for views that have been centered due to being smaller than their container. Add them to the surface positions on the saved buffer so we have the values from the time the buffer was saved.
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r--sway/desktop/render.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index bd85282c..fee19a33 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -289,10 +289,8 @@ static void render_saved_view(struct sway_view *view,
}
struct wlr_box box = {
- .x = view->container->surface_x - output->lx -
- view->saved_geometry.x + saved_buf->x,
- .y = view->container->surface_y - output->ly -
- view->saved_geometry.y + saved_buf->y,
+ .x = saved_buf->x - view->saved_geometry.x - output->lx,
+ .y = saved_buf->y - view->saved_geometry.y - output->ly,
.width = saved_buf->width,
.height = saved_buf->height,
};