aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2020-06-03 02:40:48 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2020-06-03 16:41:17 +0200
commit7670f1a521e6eacf41385324eba7cc453de9942c (patch)
treee0103a2ded9a825d20c1e5ef83ee12e27096cf1b
parenttransaction: Account for full size when centering content (diff)
downloadsway-7670f1a521e6eacf41385324eba7cc453de9942c.tar.gz
sway-7670f1a521e6eacf41385324eba7cc453de9942c.tar.zst
sway-7670f1a521e6eacf41385324eba7cc453de9942c.zip
transaction: Improve transaction commentary
Some comments where slightly misleading.
-rw-r--r--sway/desktop/transaction.c11
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