diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-13 13:30:11 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-24 15:06:07 +0400 |
| commit | b20d8e7062ce1cbbffdfa64a7b32d2393237ea26 (patch) | |
| tree | bc71ba769934573d35695848ce4afb4d614e5481 /src/input.rs | |
| parent | 3fd421f13fb823a5dd2b75d0d8649d190f932b2d (diff) | |
| download | niri-b20d8e7062ce1cbbffdfa64a7b32d2393237ea26.tar.gz niri-b20d8e7062ce1cbbffdfa64a7b32d2393237ea26.tar.bz2 niri-b20d8e7062ce1cbbffdfa64a7b32d2393237ea26.zip | |
Implement ext-session-lock
Diffstat (limited to 'src/input.rs')
| -rw-r--r-- | src/input.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/input.rs b/src/input.rs index 24504f7d..157edb59 100644 --- a/src/input.rs +++ b/src/input.rs @@ -136,7 +136,7 @@ impl State { let serial = SERIAL_COUNTER.next_serial(); let time = Event::time_msec(&event); - let action = self.niri.seat.get_keyboard().unwrap().input( + let mut action = self.niri.seat.get_keyboard().unwrap().input( self, event.key_code(), event.state(), @@ -152,6 +152,19 @@ impl State { }, ); + // Filter actions when the session is locked. + if self.niri.is_locked() { + match action { + Some( + Action::Quit + | Action::ChangeVt(_) + | Action::Suspend + | Action::PowerOffMonitors, + ) => (), + _ => action = None, + } + } + if let Some(action) = action { match action { Action::None => unreachable!(), |
