atagen

monolith

public
Star0
Watch0

Commit 41569aa8395f

tarball

atagen <boss@atagen.co>2026-10-19 07:54 UTC

2 files changed+9-3
input: keep spawn and reload binds working while locked

Dropping every bind on a locked session also killed media, volume and brightness keys, which are plain spawn binds. Command::allowed_while_locked keeps the list to commands that cannot touch windows, focus or tags.
Modified file: crates/ipc/src/lib.rs+6 additions
@@ -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, which
126+ /// 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();
Modified file: crates/monolith/src/input.rs+3 additions−3 deletions
@@ -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::Forward
113+ }
114114 Some(cmd) => {
115115 tracing::debug!(?cmd, "bind");
116116 state.input.suppressed.push(code);