From 2ca9f3ff80a62e69ab6a81c6124a8ac861206f63 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 30 Oct 2023 14:28:04 +0400 Subject: Split if into two for readability --- src/input.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/input.rs') 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; } -- cgit