diff options
Diffstat (limited to 'sway/desktop/transaction.c')
-rw-r--r-- | sway/desktop/transaction.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index 94070363..4e6af86a 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -195,11 +195,18 @@ static void transaction_apply(struct sway_transaction *transaction) { | |||
195 | sizeof(struct sway_container_state)); | 195 | sizeof(struct sway_container_state)); |
196 | 196 | ||
197 | if (container->type == C_VIEW) { | 197 | if (container->type == C_VIEW) { |
198 | if (container->sway_view->saved_buffer) { | 198 | if (container->destroying) { |
199 | view_remove_saved_buffer(container->sway_view); | 199 | if (container->instructions->length == 1 && |
200 | } | 200 | container->sway_view->saved_buffer) { |
201 | if (container->instructions->length > 1) { | 201 | view_remove_saved_buffer(container->sway_view); |
202 | view_save_buffer(container->sway_view); | 202 | } |
203 | } else { | ||
204 | if (container->sway_view->saved_buffer) { | ||
205 | view_remove_saved_buffer(container->sway_view); | ||
206 | } | ||
207 | if (container->instructions->length > 1) { | ||
208 | view_save_buffer(container->sway_view); | ||
209 | } | ||
203 | } | 210 | } |
204 | } | 211 | } |
205 | } | 212 | } |
@@ -276,9 +283,9 @@ static void transaction_commit(struct sway_transaction *transaction) { | |||
276 | // mapping and its default geometry doesn't intersect an output. | 283 | // mapping and its default geometry doesn't intersect an output. |
277 | struct timespec when; | 284 | struct timespec when; |
278 | wlr_surface_send_frame_done(con->sway_view->surface, &when); | 285 | wlr_surface_send_frame_done(con->sway_view->surface, &when); |
279 | if (!con->sway_view->saved_buffer) { | 286 | } |
280 | view_save_buffer(con->sway_view); | 287 | if (con->type == C_VIEW && !con->sway_view->saved_buffer) { |
281 | } | 288 | view_save_buffer(con->sway_view); |
282 | } | 289 | } |
283 | list_add(con->instructions, instruction); | 290 | list_add(con->instructions, instruction); |
284 | } | 291 | } |