summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-28 18:14:51 +0100
committertcmal <me@aria.rip>2024-09-05 18:16:01 +0100
commitbaa0b5fb9243332ac8837ad6965c7db35934e8c6 (patch)
tree863e22077e8dd12941d1b27aaa5c32a5d8d686c5 /src
parent250808c16b8e1179cd34f8a95c46177f25104d39 (diff)
Handle errors in event processing without dying
Diffstat (limited to 'src')
-rw-r--r--src/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index f2ad91b..d76a7a8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -93,7 +93,9 @@ impl<'a> WM<'a> {
loop {
match self.conn.wait_for_event() {
Ok(e) => {
- self.dispatch_event(e)?;
+ if let Err(err) = self.dispatch_event(e) {
+ eprintln!("error when handling event: {err:#?}\ncontinuing anyway");
+ }
}
Err(Error::Xcb(xcb::Error::Protocol(e))) => {
eprintln!("protocol error in event loop: {e:#?}\ncontinuing anyway");
@@ -120,7 +122,7 @@ impl<'a> WM<'a> {
// See clients/mod.rs
Event::X(x::Event::ConfigureRequest(e)) => {
- self.handle_configure_request(&e)?;
+ self.handle_configure_request(&e);
}
Event::X(x::Event::ConfigureNotify(e)) => {
self.handle_configure_notify(&e)?;