wayland: implement ext-idle-notifier
This commit is contained in:
parent
01e3930ced
commit
9a024fe72c
9 changed files with 287 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue