Make libinput backend work without the session feature
This commit is contained in:
parent
ae5df5039d
commit
71f107118f
|
@ -555,6 +555,7 @@ impl From<event::pointer::ButtonState> for backend::MouseButtonState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "backend_session")]
|
||||||
impl SessionObserver for libinput::Libinput {
|
impl SessionObserver for libinput::Libinput {
|
||||||
fn pause<'a>(&mut self, _state: &mut StateProxy<'a>) {
|
fn pause<'a>(&mut self, _state: &mut StateProxy<'a>) {
|
||||||
self.suspend()
|
self.suspend()
|
||||||
|
@ -568,14 +569,17 @@ impl SessionObserver for libinput::Libinput {
|
||||||
|
|
||||||
/// Wrapper for types implementing the `Session` trait to provide
|
/// Wrapper for types implementing the `Session` trait to provide
|
||||||
/// a `LibinputInterface` implementation.
|
/// a `LibinputInterface` implementation.
|
||||||
|
#[cfg(feature = "backend_session")]
|
||||||
pub struct LibinputSessionInterface<S: Session>(S);
|
pub struct LibinputSessionInterface<S: Session>(S);
|
||||||
|
|
||||||
|
#[cfg(feature = "backend_session")]
|
||||||
impl<S: Session> From<S> for LibinputSessionInterface<S> {
|
impl<S: Session> From<S> for LibinputSessionInterface<S> {
|
||||||
fn from(session: S) -> LibinputSessionInterface<S> {
|
fn from(session: S) -> LibinputSessionInterface<S> {
|
||||||
LibinputSessionInterface(session)
|
LibinputSessionInterface(session)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "backend_session")]
|
||||||
impl<S: Session> libinput::LibinputInterface for LibinputSessionInterface<S> {
|
impl<S: Session> libinput::LibinputInterface for LibinputSessionInterface<S> {
|
||||||
fn open_restricted(&mut self, path: &Path, flags: i32) -> Result<RawFd, i32> {
|
fn open_restricted(&mut self, path: &Path, flags: i32) -> Result<RawFd, i32> {
|
||||||
use nix::fcntl::OFlag;
|
use nix::fcntl::OFlag;
|
||||||
|
|
Loading…
Reference in New Issue