Save transform during transaction

Closes: https://github.com/swaywm/sway/issues/5412
This commit is contained in:
Kalyan Sriram 2020-06-05 05:13:18 -07:00 committed by GitHub
parent f7e050c58f
commit e3e548a648
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View file

@ -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
};

View file

@ -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,

View file

@ -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);
}
}