1
0
Fork 0
forked from wry/wry

wayland: implement ext-idle-notifier

This commit is contained in:
Julian Orth 2024-02-15 22:47:34 +01:00
parent 01e3930ced
commit 9a024fe72c
9 changed files with 287 additions and 3 deletions

View file

@ -173,6 +173,24 @@ impl NodeSeatState {
impl WlSeatGlobal {
pub fn event(self: &Rc<Self>, dev: &DeviceHandlerData, event: InputEvent) {
match event {
InputEvent::Key { time_usec, .. }
| InputEvent::ConnectorPosition { time_usec, .. }
| InputEvent::Motion { time_usec, .. }
| InputEvent::Button { time_usec, .. }
| InputEvent::AxisFrame { time_usec, .. } => {
self.last_input_usec.set(time_usec);
if self.idle_notifications.is_not_empty() {
for (_, notification) in self.idle_notifications.lock().drain() {
notification.resume.trigger();
}
}
}
InputEvent::AxisPx { .. }
| InputEvent::AxisSource { .. }
| InputEvent::AxisStop { .. }
| InputEvent::Axis120 { .. } => {}
}
match event {
InputEvent::Key {
time_usec,