diff options
-rw-r--r-- | sway/desktop/transaction.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index 53ecc1f0..f82e5ef2 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -175,7 +175,9 @@ static void transaction_apply(struct sway_transaction *transaction) { | |||
175 | sizeof(struct sway_container_state)); | 175 | sizeof(struct sway_container_state)); |
176 | 176 | ||
177 | if (container->type == C_VIEW && container->sway_view->saved_buffer) { | 177 | if (container->type == C_VIEW && container->sway_view->saved_buffer) { |
178 | view_remove_saved_buffer(container->sway_view); | 178 | if (!container->destroying || container->ntxnrefs == 1) { |
179 | view_remove_saved_buffer(container->sway_view); | ||
180 | } | ||
179 | } | 181 | } |
180 | 182 | ||
181 | // Damage the new location | 183 | // Damage the new location |
@@ -286,7 +288,7 @@ static void transaction_commit(struct sway_transaction *transaction) { | |||
286 | struct timespec when; | 288 | struct timespec when; |
287 | wlr_surface_send_frame_done(con->sway_view->surface, &when); | 289 | wlr_surface_send_frame_done(con->sway_view->surface, &when); |
288 | } | 290 | } |
289 | if (con->type == C_VIEW) { | 291 | if (con->type == C_VIEW && !con->sway_view->saved_buffer) { |
290 | view_save_buffer(con->sway_view); | 292 | view_save_buffer(con->sway_view); |
291 | memcpy(&con->sway_view->saved_geometry, &con->sway_view->geometry, | 293 | memcpy(&con->sway_view->saved_geometry, &con->sway_view->geometry, |
292 | sizeof(struct wlr_box)); | 294 | sizeof(struct wlr_box)); |