From cf1e3be22813d343ec177d48a926d7d9104230dd Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Mon, 8 Feb 2021 00:51:10 +0100 Subject: 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. --- sway/desktop/render.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sway/desktop/render.c') 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, }; -- cgit v1.2.3