aboutsummaryrefslogtreecommitdiff
path: root/src/input.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-10-30 14:28:04 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-10-30 14:28:04 +0400
commit2ca9f3ff80a62e69ab6a81c6124a8ac861206f63 (patch)
treec88cef809f77f2743e11075cb37796aefe6ad9a4 /src/input.rs
parentc39b8a4981830a6bee86fec59f3559fbc5dcded2 (diff)
downloadniri-2ca9f3ff80a62e69ab6a81c6124a8ac861206f63.tar.gz
niri-2ca9f3ff80a62e69ab6a81c6124a8ac861206f63.tar.bz2
niri-2ca9f3ff80a62e69ab6a81c6124a8ac861206f63.zip
Split if into two for readability
Diffstat (limited to 'src/input.rs')
-rw-r--r--src/input.rs21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/input.rs b/src/input.rs
index 06fa5abf..436a7b01 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -77,15 +77,18 @@ impl State {
};
// Filter actions when the key is released or the session is locked.
- if !pressed
- || self.niri.is_locked()
- && !matches!(
- action,
- Action::Quit
- | Action::ChangeVt(_)
- | Action::Suspend
- | Action::PowerOffMonitors
- )
+ if !pressed {
+ return;
+ }
+
+ if self.niri.is_locked()
+ && !matches!(
+ action,
+ Action::Quit
+ | Action::ChangeVt(_)
+ | Action::Suspend
+ | Action::PowerOffMonitors
+ )
{
return;
}