diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-11 20:04:44 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-12 10:45:54 +1000 |
commit | e7a7306063565f14052ed8b1d34ca19512a4fd66 (patch) | |
tree | 2ffa43c97416c007da46dd11de3525fac04a0ebc | |
parent | Make mod+resize a floating container resize the container itself (diff) | |
download | sway-e7a7306063565f14052ed8b1d34ca19512a4fd66.tar.gz sway-e7a7306063565f14052ed8b1d34ca19512a4fd66.tar.zst sway-e7a7306063565f14052ed8b1d34ca19512a4fd66.zip |
Don't progress transaction queue if any are partially complete
This fixes an issue where views might commit to a transaction ahead of
the first one, and applying the first transaction causes us to save a
buffer of the wrong size.
-rw-r--r-- | sway/desktop/transaction.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index 4e6af86a..edbe34e5 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -213,6 +213,18 @@ static void transaction_apply(struct sway_transaction *transaction) { | |||
213 | } | 213 | } |
214 | 214 | ||
215 | static void transaction_progress_queue() { | 215 | static void transaction_progress_queue() { |
216 | // Check if any transactions in the queue are in a partially ready state. | ||
217 | // If so, we shouldn't progress any transactions, even ones which are fully | ||
218 | // ready at the front of the queue, because the views in the ready | ||
219 | // transactions might have committed past it to a transaction which isn't | ||
220 | // yet ready. | ||
221 | for (int i = 0; i < server.transactions->length; ++i) { | ||
222 | struct sway_transaction *transaction = server.transactions->items[i]; | ||
223 | if (transaction->num_waiting != 0 && | ||
224 | transaction->num_waiting != transaction->num_configures) { | ||
225 | return; | ||
226 | } | ||
227 | } | ||
216 | while (server.transactions->length) { | 228 | while (server.transactions->length) { |
217 | struct sway_transaction *transaction = server.transactions->items[0]; | 229 | struct sway_transaction *transaction = server.transactions->items[0]; |
218 | if (transaction->num_waiting) { | 230 | if (transaction->num_waiting) { |