pub trait LibinputInterface {
// Required methods
fn open_restricted(
&mut self,
path: &Path,
flags: i32,
) -> Result<OwnedFd, i32>;
fn close_restricted(&mut self, fd: OwnedFd);
}
Expand description
libinput does not open file descriptors to devices directly,
instead open_restricted
and close_restricted
are called for
each path that must be opened.
Implementations are of course permitted to just use open
and
close
respectively, but doing so would require root permissions
to open devices. This interface provides an api agnostic way to
use ConsoleKit or similar endpoints to open devices without
direct priviledge escalation.