Upgrade calloop and winit (#114)

* Fix compilation with calloop 0.4

* Use `Into` instead of changing signatures

* Bump winit to 0.18

* Fix logind for calloop 0.4

* Cargo fmt
This commit is contained in:
Pablo Stebler 2018-11-17 18:01:04 +01:00 committed by Victor Berger
parent 734d2ce996
commit 630b659ae6
7 changed files with 20 additions and 15 deletions

View file

@ -8,7 +8,7 @@
### Backends
- **[Breaking]** WinitBackend: Upgrade to winit 0.17
- **[Breaking]** WinitBackend: Upgrade to winit 0.18
### Clients & Protocol

View file

@ -18,8 +18,8 @@ tempfile = "2.1.5"
slog = "2.1.1"
slog-stdlog = "3.0.2"
libloading = "0.4.0"
wayland-client = { version = "0.20.5", optional = true }
winit = { version = "0.17.0", optional = true }
wayland-client = { version = "0.21.1", features = ["egl"], optional = true }
winit = { version = "0.18.0", optional = true }
drm = { version = "^0.3.1", optional = true }
gbm = { version = "^0.4.0", optional = true, default-features = false, features = ["drm-support"] }
glium = { version = "0.19.0", optional = true, default-features = false }

View file

@ -245,7 +245,8 @@ use std::{
use wayland_server::{
calloop::{
generic::{EventedRawFd, Generic},
LoopHandle, Ready, Source,
mio::Ready,
LoopHandle, Source,
},
Display,
};
@ -558,7 +559,7 @@ where
Ok(source) => Ok((source, device)),
Err(e) => {
let device = Rc::try_unwrap(device).unwrap_or_else(|_| unreachable!());
Err((e, device.into_inner()))
Err((e.into(), device.into_inner()))
}
}
}

View file

@ -18,7 +18,8 @@ use std::{
use wayland_server::calloop::{
generic::{EventedRawFd, Generic},
LoopHandle, Ready, Source,
mio::Ready,
LoopHandle, Source,
};
// No idea if this is the same across unix platforms
@ -612,6 +613,6 @@ pub fn libinput_bind<Data: 'static>(
let backend = Rc::try_unwrap(fail_backend)
.unwrap_or_else(|_| unreachable!())
.into_inner();
(e, backend)
(e.into(), backend)
})
}

View file

@ -51,7 +51,8 @@ use systemd::login;
use wayland_server::calloop::{
generic::{Event, EventedRawFd, Generic},
LoopHandle, Ready, Source,
mio::Ready,
InsertError, LoopHandle, Source,
};
struct LogindSessionImpl {
@ -459,10 +460,10 @@ pub fn logind_session_bind<Data: 'static>(
let mut notifier = notifier.clone();
move |evt, _| notifier.event(evt)
})
}).collect::<::std::result::Result<Vec<Source<Generic<EventedRawFd>>>, IoError>>()
}).collect::<::std::result::Result<Vec<Source<Generic<EventedRawFd>>>, InsertError<Generic<EventedRawFd>>>>()
.map_err(|err| {
(
err,
err.into(),
LogindSessionNotifier {
internal: internal_for_error,
},

View file

@ -444,7 +444,7 @@ pub fn direct_session_bind<Data: 'static>(
let notifier = Rc::try_unwrap(fail_notifier)
.unwrap_or_else(|_| unreachable!())
.into_inner();
(e, notifier)
(e.into(), notifier)
})?;
Ok(BoundDirectSession { source, notifier })
}

View file

@ -29,7 +29,8 @@ use udev::{Context, Enumerator, Event, EventType, MonitorBuilder, MonitorSocket,
use wayland_server::calloop::{
generic::{EventedRawFd, Generic},
LoopHandle, Ready, Source,
mio::Ready,
LoopHandle, Source,
};
/// Udev's `DrmDevice` type based on the underlying session
@ -280,9 +281,10 @@ where
let handle = udev.handle.clone();
let mut source = Generic::from_raw_fd(fd);
source.set_interest(Ready::readable());
handle.insert_source(source, move |_, _| {
udev.process_events();
})
handle
.insert_source(source, move |_, _| {
udev.process_events();
}).map_err(Into::into)
}
impl<H, S, T, Data> UdevBackend<H, S, T, Data>