diff options
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r-- | sway/desktop/render.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index f25055b8..f0e47c95 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -199,17 +199,14 @@ static void render_saved_view(struct sway_view *view, | |||
199 | struct sway_output *output, pixman_region32_t *damage, float alpha) { | 199 | struct sway_output *output, pixman_region32_t *damage, float alpha) { |
200 | struct wlr_output *wlr_output = output->wlr_output; | 200 | struct wlr_output *wlr_output = output->wlr_output; |
201 | 201 | ||
202 | int width, height; | 202 | if (!view->saved_buffer || !view->saved_buffer->texture) { |
203 | struct wlr_texture *texture = | ||
204 | transaction_get_saved_texture(view, &width, &height); | ||
205 | if (!texture) { | ||
206 | return; | 203 | return; |
207 | } | 204 | } |
208 | struct wlr_box box = { | 205 | struct wlr_box box = { |
209 | .x = view->swayc->current.view_x - output->swayc->current.swayc_x, | 206 | .x = view->swayc->current.view_x - output->swayc->current.swayc_x, |
210 | .y = view->swayc->current.view_y - output->swayc->current.swayc_y, | 207 | .y = view->swayc->current.view_y - output->swayc->current.swayc_y, |
211 | .width = width, | 208 | .width = view->saved_buffer_width, |
212 | .height = height, | 209 | .height = view->saved_buffer_height, |
213 | }; | 210 | }; |
214 | 211 | ||
215 | struct wlr_box output_box = { | 212 | struct wlr_box output_box = { |
@@ -229,7 +226,8 @@ static void render_saved_view(struct sway_view *view, | |||
229 | wlr_matrix_project_box(matrix, &box, WL_OUTPUT_TRANSFORM_NORMAL, 0, | 226 | wlr_matrix_project_box(matrix, &box, WL_OUTPUT_TRANSFORM_NORMAL, 0, |
230 | wlr_output->transform_matrix); | 227 | wlr_output->transform_matrix); |
231 | 228 | ||
232 | render_texture(wlr_output, damage, texture, &box, matrix, alpha); | 229 | render_texture(wlr_output, damage, view->saved_buffer->texture, |
230 | &box, matrix, alpha); | ||
233 | } | 231 | } |
234 | 232 | ||
235 | /** | 233 | /** |
@@ -238,7 +236,7 @@ static void render_saved_view(struct sway_view *view, | |||
238 | static void render_view(struct sway_output *output, pixman_region32_t *damage, | 236 | static void render_view(struct sway_output *output, pixman_region32_t *damage, |
239 | struct sway_container *con, struct border_colors *colors) { | 237 | struct sway_container *con, struct border_colors *colors) { |
240 | struct sway_view *view = con->sway_view; | 238 | struct sway_view *view = con->sway_view; |
241 | if (view->swayc->instructions->length) { | 239 | if (view->saved_buffer) { |
242 | render_saved_view(view, output, damage, view->swayc->alpha); | 240 | render_saved_view(view, output, damage, view->swayc->alpha); |
243 | } else { | 241 | } else { |
244 | render_view_surfaces(view, output, damage, view->swayc->alpha); | 242 | render_view_surfaces(view, output, damage, view->swayc->alpha); |
@@ -841,7 +839,7 @@ void output_render(struct sway_output *output, struct timespec *when, | |||
841 | 839 | ||
842 | // TODO: handle views smaller than the output | 840 | // TODO: handle views smaller than the output |
843 | if (fullscreen_con->type == C_VIEW) { | 841 | if (fullscreen_con->type == C_VIEW) { |
844 | if (fullscreen_con->instructions->length) { | 842 | if (fullscreen_con->sway_view->saved_buffer) { |
845 | render_saved_view(fullscreen_con->sway_view, | 843 | render_saved_view(fullscreen_con->sway_view, |
846 | output, damage, 1.0f); | 844 | output, damage, 1.0f); |
847 | } else { | 845 | } else { |