Commit 41569aa8395f
tarball2 files changed+9-3
@@ -122,6 +122,12 @@ impl fmt::Display for ParseError {
122122
impl std::error::Error for ParseError {}123123
124124
impl Command {125
+ /// Whether a bind running this still fires on a locked session, which126
+ /// leaves out everything that moves focus, windows or tags, and quitting.127
+ pub fn allowed_while_locked(&self) -> bool {128
+ matches!(self, Command::Spawn { .. } | Command::Reload)129
+ }130
+125131
/// Parses the word form, as in `["move-container", "left"]`.126132
pub fn parse<S: AsRef<str>>(words: &[S]) -> Result<Self, ParseError> {127133
let words: Vec<&str> = words.iter().map(AsRef::as_ref).collect();@@ -107,10 +107,10 @@ impl State {
107107
let vt = (sym - xkb::keysyms::KEY_XF86Switch_VT_1 + 1) as i32;108108
return FilterResult::Intercept(Some(Action::Vt(vt)));109109
}110
- if state.services.lock.active() {111
- return FilterResult::Forward;112
- }113110
match state.settings.binds.find(mods, &handle.raw_syms()) {111
+ Some(cmd) if state.services.lock.active() && !cmd.allowed_while_locked() => {112
+ FilterResult::Forward113
+ }114114
Some(cmd) => {115115
tracing::debug!(?cmd, "bind");116116
state.input.suppressed.push(code);