aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-04-14 22:35:05 +0200
committerKenny Levinsen <kl@kl.wtf>2021-04-14 23:56:56 +0200
commit846e0838d658bdd4f03628396ba83fd5bba74320 (patch)
treec25ad318d0d7509953aa3564836f4f227ec316fc
parent7f0908546149a39f8db1e842f679364e5d1e59cb (diff)
backend/libinput: terminate display on error
-rw-r--r--backend/libinput/backend.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c
index e31ecf06..a9150558 100644
--- a/backend/libinput/backend.c
+++ b/backend/libinput/backend.c
@@ -47,9 +47,10 @@ static const struct libinput_interface libinput_impl = {
static int handle_libinput_readable(int fd, uint32_t mask, void *_backend) {
struct wlr_libinput_backend *backend = _backend;
- if (libinput_dispatch(backend->libinput_context) != 0) {
- wlr_log(WLR_ERROR, "Failed to dispatch libinput");
- // TODO: some kind of abort?
+ int ret = libinput_dispatch(backend->libinput_context);
+ if (ret != 0) {
+ wlr_log(WLR_ERROR, "Failed to dispatch libinput: %s", strerror(-ret));
+ wl_display_terminate(backend->display);
return 0;
}
struct libinput_event *event;