diff options
Diffstat (limited to 'sway/desktop/transaction.c')
-rw-r--r-- | sway/desktop/transaction.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index ccda1963..7975366e 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #define _POSIX_C_SOURCE 200809L | 1 | #define _POSIX_C_SOURCE 200809L |
2 | #include <errno.h> | ||
2 | #include <stdbool.h> | 3 | #include <stdbool.h> |
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
4 | #include <string.h> | 5 | #include <string.h> |
@@ -316,7 +317,14 @@ static void transaction_commit(struct sway_transaction *transaction) { | |||
316 | // Set up a timer which the views must respond within | 317 | // Set up a timer which the views must respond within |
317 | transaction->timer = wl_event_loop_add_timer(server.wl_event_loop, | 318 | transaction->timer = wl_event_loop_add_timer(server.wl_event_loop, |
318 | handle_timeout, transaction); | 319 | handle_timeout, transaction); |
319 | wl_event_source_timer_update(transaction->timer, txn_timeout_ms); | 320 | if (transaction->timer) { |
321 | wl_event_source_timer_update(transaction->timer, txn_timeout_ms); | ||
322 | } else { | ||
323 | wlr_log(WLR_ERROR, "Unable to create transaction timer (%s). " | ||
324 | "Some imperfect frames might be rendered.", | ||
325 | strerror(errno)); | ||
326 | handle_timeout(transaction); | ||
327 | } | ||
320 | } | 328 | } |
321 | 329 | ||
322 | // The debug tree shows the pending/live tree. Here is a good place to | 330 | // The debug tree shows the pending/live tree. Here is a good place to |