From e3e548a64861749474d87904875655904023b335 Mon Sep 17 00:00:00 2001 From: Kalyan Sriram Date: Fri, 5 Jun 2020 05:13:18 -0700 Subject: [PATCH] Save transform during transaction Closes: https://github.com/swaywm/sway/issues/5412 --- include/sway/tree/view.h | 1 + sway/desktop/render.c | 3 ++- sway/tree/view.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 53c5d34ee..8898cde51 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -59,6 +59,7 @@ struct sway_saved_buffer { struct wlr_client_buffer *buffer; int x, y; int width, height; + enum wl_output_transform transform; struct wl_list link; // sway_view::saved_buffers }; diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 491a9bc08..2996e135c 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -312,7 +312,8 @@ static void render_saved_view(struct sway_view *view, scale_box(&box, wlr_output->scale); float matrix[9]; - wlr_matrix_project_box(matrix, &box, WL_OUTPUT_TRANSFORM_NORMAL, 0, + enum wl_output_transform transform = wlr_output_transform_invert(saved_buf->transform); + wlr_matrix_project_box(matrix, &box, transform, 0, wlr_output->transform_matrix); render_texture(wlr_output, damage, saved_buf->buffer->texture, diff --git a/sway/tree/view.c b/sway/tree/view.c index a90346376..314fd3819 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -1199,6 +1199,7 @@ static void view_save_buffer_iterator(struct wlr_surface *surface, saved_buffer->height = surface->current.height; saved_buffer->x = sx; saved_buffer->y = sy; + saved_buffer->transform = surface->current.transform; wl_list_insert(&view->saved_buffers, &saved_buffer->link); } }