aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/desktop
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-01 16:23:11 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-08-01 16:24:15 +1000
commitd10ccc1eb144e4de2477398f6b11753f6b7df70b (patch)
treea4792f1ca754ed427a5b472d1bcf3e75fcf1f2ef /include/sway/desktop
parentMerge pull request #2395 from RedSoxFan/create-mouse-binding-list (diff)
downloadsway-d10ccc1eb144e4de2477398f6b11753f6b7df70b.tar.gz
sway-d10ccc1eb144e4de2477398f6b11753f6b7df70b.tar.zst
sway-d10ccc1eb144e4de2477398f6b11753f6b7df70b.zip
Correctly track saved surfaces during multiple transactions
Fixes #2364. Suppose a view is 600px wide, and we tell it to resize to 601px during a resize operation. We create a transaction, save the 600px buffer and send the configure. This buffer is saved into the associated instruction, and is rendered while we wait for the view to commit a 601px buffer. Before the view commits the 601px buffer, suppose we tell it to resize to 602px. The new transaction will also save the buffer, but it's still the 600px buffer because we haven't received a new one yet. Then suppose the view commits its original 601px buffer. This completes the first transaction, so we apply the 601px width to the container. There's still the second (now only) transaction remaining, so we render the saved buffer from that. But this is still the 600px buffer, and we believe it's 601px. Whoops. The problem here is we can't stack buffers like this. So this commit removes the saved buffer from the instructions, places it in the view instead, and re-saves the latest buffer every time the view completes a transaction and still has further pending transactions. As saved buffers are now specific to views rather than instructions, the functions for saving and removing the saved buffer have been moved to view.c. The calls to save and restore the buffer have been relocated to more appropriate functions too, favouring transaction_commit and transaction_apply rather than transaction_add_container and transaction_destroy.
Diffstat (limited to 'include/sway/desktop')
-rw-r--r--include/sway/desktop/transaction.h13
1 files changed, 0 insertions, 13 deletions
diff --git a/include/sway/desktop/transaction.h b/include/sway/desktop/transaction.h
index cee4afed..56361d94 100644
--- a/include/sway/desktop/transaction.h
+++ b/include/sway/desktop/transaction.h
@@ -42,17 +42,4 @@ void transaction_notify_view_ready(struct sway_view *view, uint32_t serial);
42void transaction_notify_view_ready_by_size(struct sway_view *view, 42void transaction_notify_view_ready_by_size(struct sway_view *view,
43 int width, int height); 43 int width, int height);
44 44
45/**
46 * Get the saved texture that should be rendered for a view.
47 *
48 * The addresses pointed at by the width and height pointers will be populated
49 * with the surface's dimensions, which may be different to the texture's
50 * dimensions if output scaling is used.
51 *
52 * This function should only be called if it is known that the view has
53 * instructions.
54 */
55struct wlr_texture *transaction_get_saved_texture(struct sway_view *view,
56 int *width, int *height);
57
58#endif 45#endif