From f77a7257518d3c2dde9562737e64bce7a945ba92 Mon Sep 17 00:00:00 2001
From: patrick96
Date: Sun, 20 Mar 2022 19:11:30 +0100
Subject: [PATCH] Print XCB event ID if error occurs
Makes it much easier to debug from error messages.
---
src/components/controller.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/components/controller.cpp b/src/components/controller.cpp
index cb6651b6..0ec9a2e7 100644
--- a/src/components/controller.cpp
+++ b/src/components/controller.cpp
@@ -178,7 +178,8 @@ void controller::conn_cb() {
m_log.err("X connection error, terminating... (what: %s)", m_connection.error_str(err.code()));
stop(false);
} catch (const exception& err) {
- m_log.err("Error in X event loop: %s", err.what());
+ // IDs for events are defined in xproto.h
+ m_log.err("Error in X event loop while handling event %d: %s", evt->response_type, err.what());
stop(false);
}
}