Fix udev example

This commit is contained in:
Drakulix 2017-12-07 15:20:33 +01:00
parent 40ef1236ea
commit 5f59ded3f0
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ extern crate glium;
extern crate rand; extern crate rand;
extern crate input as libinput; extern crate input as libinput;
extern crate image; extern crate image;
extern crate libudev; extern crate udev;
#[macro_use(define_roles)] #[macro_use(define_roles)]
extern crate smithay; extern crate smithay;
extern crate xkbcommon; extern crate xkbcommon;
@ -201,7 +201,7 @@ fn main() {
/* /*
* Initialize the udev backend * Initialize the udev backend
*/ */
let context = libudev::Context::new().unwrap(); let context = udev::Context::new().unwrap();
let bytes = include_bytes!("resources/cursor2.rgba"); let bytes = include_bytes!("resources/cursor2.rgba");
let udev_token let udev_token
= UdevBackend::new(&mut event_loop, &context, session.clone(), UdevHandlerImpl { = UdevBackend::new(&mut event_loop, &context, session.clone(), UdevHandlerImpl {

View File

@ -147,7 +147,7 @@ impl<B: From<DrmBackend> + Borrow<DrmBackend> + 'static, H: DrmHandler<B> + 'sta
/// Make sure not to borrow any tokens twice. /// Make sure not to borrow any tokens twice.
pub fn close<'a, ST: Into<StateProxy<'a>>>(mut self, state: ST) { pub fn close<'a, ST: Into<StateProxy<'a>>>(mut self, state: ST) {
let mut state = state.into(); let mut state = state.into();
for (_, (mut device, event_source)) in self.devices.drain() { for (_, (device, event_source)) in self.devices.drain() {
event_source.remove(); event_source.remove();
self.handler.device_removed(&mut state, &device); self.handler.device_removed(&mut state, &device);
let device = state.remove(device); let device = state.remove(device);