mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 09:51:29 +00:00
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.
This commit is contained in:
parent
4d023c0390
commit
e7a7306063
|
@ -213,6 +213,18 @@ static void transaction_apply(struct sway_transaction *transaction) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void transaction_progress_queue() {
|
static void transaction_progress_queue() {
|
||||||
|
// Check if any transactions in the queue are in a partially ready state.
|
||||||
|
// If so, we shouldn't progress any transactions, even ones which are fully
|
||||||
|
// ready at the front of the queue, because the views in the ready
|
||||||
|
// transactions might have committed past it to a transaction which isn't
|
||||||
|
// yet ready.
|
||||||
|
for (int i = 0; i < server.transactions->length; ++i) {
|
||||||
|
struct sway_transaction *transaction = server.transactions->items[i];
|
||||||
|
if (transaction->num_waiting != 0 &&
|
||||||
|
transaction->num_waiting != transaction->num_configures) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
while (server.transactions->length) {
|
while (server.transactions->length) {
|
||||||
struct sway_transaction *transaction = server.transactions->items[0];
|
struct sway_transaction *transaction = server.transactions->items[0];
|
||||||
if (transaction->num_waiting) {
|
if (transaction->num_waiting) {
|
||||||
|
|
Loading…
Reference in a new issue