diff options
Diffstat (limited to 'sway/desktop/transaction.c')
-rw-r--r-- | sway/desktop/transaction.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index ccf60514..ef656102 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -210,14 +210,17 @@ static void apply_container_state(struct sway_container *container, | |||
210 | struct sway_view *view = container->view; | 210 | struct sway_view *view = container->view; |
211 | // Damage the old location | 211 | // Damage the old location |
212 | desktop_damage_whole_container(container); | 212 | desktop_damage_whole_container(container); |
213 | if (view && view->saved_buffer) { | 213 | if (view && !wl_list_empty(&view->saved_buffers)) { |
214 | struct wlr_box box = { | 214 | struct sway_saved_buffer *saved_buf; |
215 | .x = container->current.content_x - view->saved_geometry.x, | 215 | wl_list_for_each(saved_buf, &view->saved_buffers, link) { |
216 | .y = container->current.content_y - view->saved_geometry.y, | 216 | struct wlr_box box = { |
217 | .width = view->saved_buffer_width, | 217 | .x = container->current.content_x - view->saved_geometry.x + saved_buf->x, |
218 | .height = view->saved_buffer_height, | 218 | .y = container->current.content_y - view->saved_geometry.y + saved_buf->y, |
219 | }; | 219 | .width = saved_buf->width, |
220 | desktop_damage_box(&box); | 220 | .height = saved_buf->height, |
221 | }; | ||
222 | desktop_damage_box(&box); | ||
223 | } | ||
221 | } | 224 | } |
222 | 225 | ||
223 | // There are separate children lists for each instruction state, the | 226 | // There are separate children lists for each instruction state, the |
@@ -229,7 +232,7 @@ static void apply_container_state(struct sway_container *container, | |||
229 | 232 | ||
230 | memcpy(&container->current, state, sizeof(struct sway_container_state)); | 233 | memcpy(&container->current, state, sizeof(struct sway_container_state)); |
231 | 234 | ||
232 | if (view && view->saved_buffer) { | 235 | if (view && !wl_list_empty(&view->saved_buffers)) { |
233 | if (!container->node.destroying || container->node.ntxnrefs == 1) { | 236 | if (!container->node.destroying || container->node.ntxnrefs == 1) { |
234 | view_remove_saved_buffer(view); | 237 | view_remove_saved_buffer(view); |
235 | } | 238 | } |
@@ -432,7 +435,7 @@ static void transaction_commit(struct sway_transaction *transaction) { | |||
432 | wlr_surface_send_frame_done( | 435 | wlr_surface_send_frame_done( |
433 | node->sway_container->view->surface, &now); | 436 | node->sway_container->view->surface, &now); |
434 | } | 437 | } |
435 | if (node_is_view(node) && !node->sway_container->view->saved_buffer) { | 438 | if (node_is_view(node) && wl_list_empty(&node->sway_container->view->saved_buffers)) { |
436 | view_save_buffer(node->sway_container->view); | 439 | view_save_buffer(node->sway_container->view); |
437 | memcpy(&node->sway_container->view->saved_geometry, | 440 | memcpy(&node->sway_container->view->saved_geometry, |
438 | &node->sway_container->view->geometry, | 441 | &node->sway_container->view->geometry, |