wayland: improve diagnostic of failed init (#512)

This commit is contained in:
Victor Berger 2018-05-12 13:58:11 +02:00 committed by Francesca Frangipane
parent b4a8c08f43
commit ffa9b51d27
4 changed files with 9 additions and 10 deletions

View file

@ -6,6 +6,8 @@ use std::ffi::CStr;
use std::os::raw::*;
use std::sync::Arc;
use sctk::reexports::client::ConnectError;
// `std::os::raw::c_void` and `libc::c_void` are NOT interchangeable!
use libc;
@ -395,10 +397,9 @@ r#"Failed to initialize any backend!
panic!(err_string);
}
pub fn new_wayland() -> Result<EventsLoop, ()> {
pub fn new_wayland() -> Result<EventsLoop, ConnectError> {
wayland::EventsLoop::new()
.map(EventsLoop::Wayland)
.ok_or(())
}
pub fn new_x11() -> Result<EventsLoop, XNotSupported> {