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.
This commit is contained in:
Victor Brekenfeld 2021-07-10 19:55:49 +02:00
parent 510c0a5400
commit 4649a34f77
1 changed files with 5 additions and 2 deletions

View File

@ -441,10 +441,13 @@ impl AnvilState<UdevData> {
#[cfg(feature = "egl")] #[cfg(feature = "egl")]
if path.canonicalize().ok() == self.backend_data.primary_gpu { if path.canonicalize().ok() == self.backend_data.primary_gpu {
info!(self.log, "Initializing EGL Hardware Acceleration via {:?}", path); info!(self.log, "Initializing EGL Hardware Acceleration via {:?}", path);
renderer if renderer
.borrow_mut() .borrow_mut()
.bind_wl_display(&*self.display.borrow()) .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( let backends = Rc::new(RefCell::new(scan_connectors(