Added bad error handling for awesome set up failure
This is a bad monkey patch set up so that during further testing if
there's a failure during lua setup the compositor won't hang (which is
very bad on (tm) on DRM)
//! This handles the XWayland server and any XWayland clients that connect to
//! Way Cooler.
+use awesome;
+use std::panic;
use wlroots::{Compositor, XWaylandManagerHandler};
+
pub struct XWaylandManager;
impl XWaylandManager {
@@ -12,6 +15,13 @@ impl XWaylandManager {
impl XWaylandManagerHandler for XWaylandManager {
fn on_ready(&mut self, _: &mut Compositor) {
- ::awesome::lua::setup_lua();
+ // TODO Do this properly with Results!
+ match panic::catch_unwind(|| ::awesome::lua::setup_lua()) {
+ Ok(_) => {},
+ Err(err) => {
+ awesome::lua::terminate();
+ panic::resume_unwind(err)
+ }
+ }
}
}
