aboutsummaryrefslogtreecommitdiff
path: root/src/input.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/input.rs')
-rw-r--r--src/input.rs15
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!(),