aboutsummaryrefslogtreecommitdiff
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-07-28 09:05:28 -0400
committerGitHub <noreply@github.com>2018-07-28 09:05:28 -0400
commite4b54ac16e52cea9fe7f8385e87033764d36522f (patch)
tree68a12cfe22d349eada6dba59cf6c5c4ef8ec8620 /sway/input/seat.c
parent68d6307aa67f2aab16bfbbf56427666cde964a6c (diff)
parenta4bcddcfdc67ef64edf3737342a99c4e41cae6d4 (diff)
Merge pull request #2368 from RyanDwyer/handle-out-of-fds
Handle out-of-fd situations gracefully for transaction and urgent timers
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index e7b6e0c5..b783a84f 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -1,6 +1,7 @@
#define _XOPEN_SOURCE 700
#define _POSIX_C_SOURCE 199309L
#include <assert.h>
+#include <errno.h>
#ifdef __linux__
#include <linux/input-event-codes.h>
#elif __FreeBSD__
@@ -696,8 +697,14 @@ void seat_set_focus_warp(struct sway_seat *seat,
config->urgent_timeout > 0) {
view->urgent_timer = wl_event_loop_add_timer(server.wl_event_loop,
handle_urgent_timeout, view);
- wl_event_source_timer_update(view->urgent_timer,
- config->urgent_timeout);
+ if (view->urgent_timer) {
+ wl_event_source_timer_update(view->urgent_timer,
+ config->urgent_timeout);
+ } else {
+ wlr_log(WLR_ERROR, "Unable to create urgency timer (%s)",
+ strerror(errno));
+ handle_urgent_timeout(view);
+ }
} else {
view_set_urgent(view, false);
}