aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/transaction.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/transaction.c')
-rw-r--r--sway/desktop/transaction.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index 2b3f87c3..5e42fde5 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -19,14 +19,14 @@
19 * How long we should wait for views to respond to the configure before giving 19 * How long we should wait for views to respond to the configure before giving
20 * up and applying the transaction anyway. 20 * up and applying the transaction anyway.
21 */ 21 */
22#define TIMEOUT_MS 200 22int txn_timeout_ms = 200;
23 23
24/** 24/**
25 * If enabled, sway will always wait for the transaction timeout before 25 * If enabled, sway will always wait for the transaction timeout before
26 * applying it, rather than applying it when the views are ready. This allows us 26 * applying it, rather than applying it when the views are ready. This allows us
27 * to observe the rendered state while a transaction is in progress. 27 * to observe the rendered state while a transaction is in progress.
28 */ 28 */
29#define TRANSACTION_DEBUG false 29bool txn_debug = false;
30 30
31struct sway_transaction { 31struct sway_transaction {
32 struct wl_event_source *timer; 32 struct wl_event_source *timer;
@@ -330,7 +330,7 @@ void transaction_commit(struct sway_transaction *transaction) {
330 // Set up a timer which the views must respond within 330 // Set up a timer which the views must respond within
331 transaction->timer = wl_event_loop_add_timer(server.wl_event_loop, 331 transaction->timer = wl_event_loop_add_timer(server.wl_event_loop,
332 handle_timeout, transaction); 332 handle_timeout, transaction);
333 wl_event_source_timer_update(transaction->timer, TIMEOUT_MS); 333 wl_event_source_timer_update(transaction->timer, txn_timeout_ms);
334 } 334 }
335 335
336 // The debug tree shows the pending/live tree. Here is a good place to 336 // The debug tree shows the pending/live tree. Here is a good place to
@@ -361,11 +361,11 @@ static void set_instruction_ready(
361 // If all views are ready, apply the transaction. 361 // If all views are ready, apply the transaction.
362 // If the transaction has timed out then its num_waiting will be 0 already. 362 // If the transaction has timed out then its num_waiting will be 0 already.
363 if (transaction->num_waiting > 0 && --transaction->num_waiting == 0) { 363 if (transaction->num_waiting > 0 && --transaction->num_waiting == 0) {
364#if !TRANSACTION_DEBUG 364 if (!txn_debug) {
365 wlr_log(WLR_DEBUG, "Transaction %p is ready", transaction); 365 wlr_log(WLR_DEBUG, "Transaction %p is ready", transaction);
366 wl_event_source_timer_update(transaction->timer, 0); 366 wl_event_source_timer_update(transaction->timer, 0);
367 transaction_progress_queue(); 367 transaction_progress_queue();
368#endif 368 }
369 } 369 }
370} 370}
371 371