Split if into two for readability
Browse files at this commit2ca9f3ff80a62e69ab6a81c6124a8ac861206f63Parent: c39b8a41 changed file +12 -9
- src/input.rs +12 -9
src/input.rsmodified+12 -9
| @@ -77,15 +77,18 @@ impl State { | ||
| 77 | 77 | }; |
| 78 | 78 | |
| 79 | 79 | // Filter actions when the key is released or the session is locked. |
| 80 | - if !pressed | |
| 81 | - || self.niri.is_locked() | |
| 82 | - && !matches!( | |
| 83 | - action, | |
| 84 | - Action::Quit | |
| 85 | - | Action::ChangeVt(_) | |
| 86 | - | Action::Suspend | |
| 87 | - | Action::PowerOffMonitors | |
| 88 | - ) | |
| 80 | + if !pressed { | |
| 81 | + return; | |
| 82 | + } | |
| 83 | + | |
| 84 | + if self.niri.is_locked() | |
| 85 | + && !matches!( | |
| 86 | + action, | |
| 87 | + Action::Quit | |
| 88 | + | Action::ChangeVt(_) | |
| 89 | + | Action::Suspend | |
| 90 | + | Action::PowerOffMonitors | |
| 91 | + ) | |
| 89 | 92 | { |
| 90 | 93 | return; |
| 91 | 94 | } |