wayland: mugrate to new API

This commit is contained in:
Victor Berger 2017-03-04 14:04:01 +01:00
parent 9aaa788434
commit 7336cacf07
6 changed files with 310 additions and 305 deletions

View file

@ -129,7 +129,12 @@ impl Window2 {
{
match *UNIX_BACKEND {
UnixBackend::Wayland(ref ctxt) => {
wayland::Window2::new(events_loop, ctxt.clone(), window).map(Window2::Wayland)
if let EventsLoop::Wayland(ref evlp) = *events_loop {
wayland::Window2::new(evlp, ctxt.clone(), window).map(Window2::Wayland)
} else {
// It is not possible to instanciate an EventsLoop not matching its backend
unreachable!()
}
},
UnixBackend::X(ref connec) => {
@ -299,8 +304,8 @@ pub enum EventsLoop {
impl EventsLoop {
pub fn new() -> EventsLoop {
match *UNIX_BACKEND {
UnixBackend::Wayland(_) => {
EventsLoop::Wayland(wayland::EventsLoop::new())
UnixBackend::Wayland(ref ctxt) => {
EventsLoop::Wayland(wayland::EventsLoop::new(ctxt.clone()))
},
UnixBackend::X(_) => {