From 4649a34f77038ffb5bf17085dcd8745c2dbc8e1b Mon Sep 17 00:00:00 2001 From: Victor Brekenfeld Date: Sat, 10 Jul 2021 19:55:49 +0200 Subject: [PATCH] anvil: Fix initialization when `bind_wl_display` fails. If the `egl`-feature is enabled, but `bind_wl_display` fails (e.g. when software rendering via llvmpipe is in use), we should not fail to start. --- anvil/src/udev.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/anvil/src/udev.rs b/anvil/src/udev.rs index 3798eae..ac7d75c 100644 --- a/anvil/src/udev.rs +++ b/anvil/src/udev.rs @@ -441,10 +441,13 @@ impl AnvilState { #[cfg(feature = "egl")] if path.canonicalize().ok() == self.backend_data.primary_gpu { info!(self.log, "Initializing EGL Hardware Acceleration via {:?}", path); - renderer + if renderer .borrow_mut() .bind_wl_display(&*self.display.borrow()) - .expect("Unable to bind Wl Display?"); + .is_ok() + { + info!(self.log, "EGL hardware-acceleration enabled"); + } } let backends = Rc::new(RefCell::new(scan_connectors(