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

@ -3,6 +3,7 @@ use {
backend::InputDevice,
ifs::wl_seat::PX_PER_SCROLL,
state::{DeviceHandlerData, InputDeviceData, State},
tasks::udev_utils::{udev_props, UdevProps},
utils::asyncevent::AsyncEvent,
},
std::{cell::Cell, rc::Rc},
@ -22,6 +23,10 @@ pub fn handle(state: &Rc<State>, dev: Rc<dyn InputDevice>) {
ae: ae.clone(),
};
let handler = state.eng.spawn(oh.handle());
let props = match dev.dev_t() {
None => UdevProps::default(),
Some(dev_t) => udev_props(dev_t, 3),
};
state.input_device_handlers.borrow_mut().insert(
dev.id(),
InputDeviceData {
@ -29,6 +34,8 @@ pub fn handle(state: &Rc<State>, dev: Rc<dyn InputDevice>) {
id: dev.id(),
data,
async_event: ae,
syspath: props.syspath,
devnode: props.devnode,
},
);
}