diff options
-rw-r--r-- | sway/desktop/transaction.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index aadd8ba5..053312a5 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -341,8 +341,8 @@ static void transaction_progress_queue(void) { | |||
341 | if (!server.transactions->length) { | 341 | if (!server.transactions->length) { |
342 | return; | 342 | return; |
343 | } | 343 | } |
344 | // There's only ever one committed transaction, | 344 | // Only the first transaction in the queue is committed, so that's the one |
345 | // and it's the first one in the queue. | 345 | // we try to process. |
346 | struct sway_transaction *transaction = server.transactions->items[0]; | 346 | struct sway_transaction *transaction = server.transactions->items[0]; |
347 | if (transaction->num_waiting) { | 347 | if (transaction->num_waiting) { |
348 | return; | 348 | return; |
@@ -351,7 +351,8 @@ static void transaction_progress_queue(void) { | |||
351 | transaction_destroy(transaction); | 351 | transaction_destroy(transaction); |
352 | list_del(server.transactions, 0); | 352 | list_del(server.transactions, 0); |
353 | 353 | ||
354 | if (!server.transactions->length) { | 354 | if (server.transactions->length == 0) { |
355 | // The transaction queue is empty, so we're done. | ||
355 | sway_idle_inhibit_v1_check_active(server.idle_inhibit_manager_v1); | 356 | sway_idle_inhibit_v1_check_active(server.idle_inhibit_manager_v1); |
356 | return; | 357 | return; |
357 | } | 358 | } |
@@ -369,6 +370,7 @@ static void transaction_progress_queue(void) { | |||
369 | } | 370 | } |
370 | } | 371 | } |
371 | 372 | ||
373 | // We again commit the first transaction in the queue to process it. | ||
372 | transaction = server.transactions->items[0]; | 374 | transaction = server.transactions->items[0]; |
373 | transaction_commit(transaction); | 375 | transaction_commit(transaction); |
374 | transaction_progress_queue(); | 376 | transaction_progress_queue(); |
@@ -533,8 +535,7 @@ void transaction_commit_dirty(void) { | |||
533 | 535 | ||
534 | list_add(server.transactions, transaction); | 536 | list_add(server.transactions, transaction); |
535 | 537 | ||
536 | // There's only ever one committed transaction, | 538 | // We only commit the first transaction added to the queue. |
537 | // and it's the first one in the queue. | ||
538 | if (server.transactions->length == 1) { | 539 | if (server.transactions->length == 1) { |
539 | transaction_commit(transaction); | 540 | transaction_commit(transaction); |
540 | // Attempting to progress the queue here is useful | 541 | // Attempting to progress the queue here is useful |