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 ea4361f2..1f374740 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -222,17 +222,14 @@ static void render_saved_view(struct sway_view *view, | |||
222 | struct sway_output *output, pixman_region32_t *damage, float alpha) { | 222 | struct sway_output *output, pixman_region32_t *damage, float alpha) { |
223 | struct wlr_output *wlr_output = output->wlr_output; | 223 | struct wlr_output *wlr_output = output->wlr_output; |
224 | 224 | ||
225 | int width, height; | 225 | if (!view->saved_buffer || !view->saved_buffer->texture) { |
226 | struct wlr_texture *texture = | ||
227 | transaction_get_saved_texture(view, &width, &height); | ||
228 | if (!texture) { | ||
229 | return; | 226 | return; |
230 | } | 227 | } |
231 | struct wlr_box box = { | 228 | struct wlr_box box = { |
232 | .x = view->swayc->current.view_x - output->swayc->current.swayc_x, | 229 | .x = view->swayc->current.view_x - output->swayc->current.swayc_x, |
233 | .y = view->swayc->current.view_y - output->swayc->current.swayc_y, | 230 | .y = view->swayc->current.view_y - output->swayc->current.swayc_y, |
234 | .width = width, | 231 | .width = view->saved_buffer_width, |
235 | .height = height, | 232 | .height = view->saved_buffer_height, |
236 | }; | 233 | }; |
237 | 234 | ||
238 | struct wlr_box output_box = { | 235 | struct wlr_box output_box = { |
@@ -252,7 +249,8 @@ static void render_saved_view(struct sway_view *view, | |||
252 | wlr_matrix_project_box(matrix, &box, WL_OUTPUT_TRANSFORM_NORMAL, 0, | 249 | wlr_matrix_project_box(matrix, &box, WL_OUTPUT_TRANSFORM_NORMAL, 0, |
253 | wlr_output->transform_matrix); | 250 | wlr_output->transform_matrix); |
254 | 251 | ||
255 | render_texture(wlr_output, damage, texture, &box, matrix, alpha); | 252 | render_texture(wlr_output, damage, view->saved_buffer->texture, |
253 | &box, matrix, alpha); | ||
256 | } | 254 | } |
257 | 255 | ||
258 | /** | 256 | /** |
@@ -261,7 +259,7 @@ static void render_saved_view(struct sway_view *view, | |||
261 | static void render_view(struct sway_output *output, pixman_region32_t *damage, | 259 | static void render_view(struct sway_output *output, pixman_region32_t *damage, |
262 | struct sway_container *con, struct border_colors *colors) { | 260 | struct sway_container *con, struct border_colors *colors) { |
263 | struct sway_view *view = con->sway_view; | 261 | struct sway_view *view = con->sway_view; |
264 | if (view->swayc->instructions->length) { | 262 | if (view->saved_buffer) { |
265 | render_saved_view(view, output, damage, view->swayc->alpha); | 263 | render_saved_view(view, output, damage, view->swayc->alpha); |
266 | } else { | 264 | } else { |
267 | render_view_toplevels(view, output, damage, view->swayc->alpha); | 265 | render_view_toplevels(view, output, damage, view->swayc->alpha); |
@@ -864,7 +862,7 @@ void output_render(struct sway_output *output, struct timespec *when, | |||
864 | 862 | ||
865 | // TODO: handle views smaller than the output | 863 | // TODO: handle views smaller than the output |
866 | if (fullscreen_con->type == C_VIEW) { | 864 | if (fullscreen_con->type == C_VIEW) { |
867 | if (fullscreen_con->instructions->length) { | 865 | if (fullscreen_con->sway_view->saved_buffer) { |
868 | render_saved_view(fullscreen_con->sway_view, | 866 | render_saved_view(fullscreen_con->sway_view, |
869 | output, damage, 1.0f); | 867 | output, damage, 1.0f); |
870 | } else { | 868 | } else { |