From 71f107118fafad12e05486b409e4bb2a31cb54fe Mon Sep 17 00:00:00 2001 From: Drakulix Date: Sun, 3 Dec 2017 22:44:45 +0100 Subject: [PATCH] Make libinput backend work without the session feature --- src/backend/libinput.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/libinput.rs b/src/backend/libinput.rs index 80d2eb8..4c27a3b 100644 --- a/src/backend/libinput.rs +++ b/src/backend/libinput.rs @@ -555,6 +555,7 @@ impl From for backend::MouseButtonState { } } +#[cfg(feature = "backend_session")] impl SessionObserver for libinput::Libinput { fn pause<'a>(&mut self, _state: &mut StateProxy<'a>) { self.suspend() @@ -568,14 +569,17 @@ impl SessionObserver for libinput::Libinput { /// Wrapper for types implementing the `Session` trait to provide /// a `LibinputInterface` implementation. +#[cfg(feature = "backend_session")] pub struct LibinputSessionInterface(S); +#[cfg(feature = "backend_session")] impl From for LibinputSessionInterface { fn from(session: S) -> LibinputSessionInterface { LibinputSessionInterface(session) } } +#[cfg(feature = "backend_session")] impl libinput::LibinputInterface for LibinputSessionInterface { fn open_restricted(&mut self, path: &Path, flags: i32) -> Result { use nix::fcntl::OFlag;