1
0
Fork 0
forked from wry/wry

backend: add syspath and devnode to input devices

This commit is contained in:
Julian Orth 2024-03-12 16:37:16 +01:00
parent 813f87faaa
commit 283e438d1b
9 changed files with 107 additions and 64 deletions

View file

@ -281,7 +281,7 @@ pub async fn create(state: &Rc<State>) -> Result<Rc<MetalBackend>, MetalError> {
struct MetalInputDevice {
slot: usize,
id: InputDeviceId,
_devnum: c::dev_t,
devnum: c::dev_t,
fd: CloneCell<Option<Rc<OwnedFd>>>,
inputdev: CloneCell<Option<Rc<RegisteredDevice>>>,
devnode: CString,
@ -509,6 +509,10 @@ impl InputDevice for MetalInputDevice {
self.name.get()
}
fn dev_t(&self) -> Option<c::dev_t> {
Some(self.devnum)
}
fn set_tap_enabled(&self, enabled: bool) {
self.desired.tap_enabled.set(Some(enabled));
if let Some(dev) = self.inputdev.get() {