Skip to content

Commit

Permalink
Save transform during transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
coderkalyan committed Jun 3, 2020
1 parent f8dd7df commit f6f78f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/sway/tree/view.h
Expand Up @@ -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
};

Expand Down
2 changes: 1 addition & 1 deletion sway/desktop/render.c
Expand Up @@ -312,7 +312,7 @@ 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,
wlr_matrix_project_box(matrix, &box, saved_buf->transform, 0,
wlr_output->transform_matrix);

render_texture(wlr_output, damage, saved_buf->buffer->texture,
Expand Down
1 change: 1 addition & 0 deletions sway/tree/view.c
Expand Up @@ -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 = wlr_output_transform_invert(surface->current.transform);
wl_list_insert(&view->saved_buffers, &saved_buffer->link);
}
}
Expand Down

0 comments on commit f6f78f4

Please sign in to comment.