aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-04-14 22:42:12 +0200
committerKenny Levinsen <kl@kl.wtf>2021-04-14 23:56:56 +0200
commit1e5460d4c6260e523e08613b767948b68cc36b52 (patch)
tree53994e50de51324789caa781efb7c2aa24da3961
parent053ebe7c278ba1e5a0c8c9f5559db23fad5a9eba (diff)
backend/x11: check for connection errors
-rw-r--r--backend/x11/backend.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index 95325a68..4d825631 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -133,6 +133,9 @@ static int x11_event(int fd, uint32_t mask, void *data) {
struct wlr_x11_backend *x11 = data;
if ((mask & WL_EVENT_HANGUP) || (mask & WL_EVENT_ERROR)) {
+ if (mask & WL_EVENT_ERROR) {
+ wlr_log(WLR_ERROR, "Failed to read from X11 server");
+ }
wl_display_terminate(x11->wl_display);
return 0;
}
@@ -143,6 +146,12 @@ static int x11_event(int fd, uint32_t mask, void *data) {
free(e);
}
+ int ret = xcb_connection_has_error(x11->xcb);
+ if (ret != 0) {
+ wlr_log(WLR_ERROR, "X11 connection error (%d)", ret);
+ wl_display_terminate(x11->wl_display);
+ }
+
return 0;
}