diff options
Diffstat (limited to 'crates/platform')
| -rw-r--r-- | crates/platform/src/ipc/dispatch.rs | 7 | ||||
| -rw-r--r-- | crates/platform/src/ipc/types.rs | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/crates/platform/src/ipc/dispatch.rs b/crates/platform/src/ipc/dispatch.rs index ad79b98..b0f0cba 100644 --- a/crates/platform/src/ipc/dispatch.rs +++ b/crates/platform/src/ipc/dispatch.rs @@ -424,8 +424,11 @@ pub(crate) fn handle_request(line: &[u8], wm: &std::rc::Rc<std::cell::RefCell<Wi // outside this process could see a binding at all before this. "keybindings" => { let wm = wm.borrow(); - let list: Vec<KeybindingInfo> = - wm.keybindings.iter().map(|(combo, description)| KeybindingInfo { combo: combo.clone(), description: description.clone() }).collect(); + let list: Vec<KeybindingInfo> = wm + .keybindings + .iter() + .map(|b| KeybindingInfo { combo: b.combo.clone(), description: b.description.clone(), grabbed: b.grabbed }) + .collect(); (serde_json::to_vec(&KeybindingsResponse { keybindings: list }).unwrap_or_default(), false) } "set" => handle_set(&req, wm), diff --git a/crates/platform/src/ipc/types.rs b/crates/platform/src/ipc/types.rs index 286df20..3243e31 100644 --- a/crates/platform/src/ipc/types.rs +++ b/crates/platform/src/ipc/types.rs @@ -129,6 +129,11 @@ pub(crate) struct MonitorsResponse { pub(crate) struct KeybindingInfo { pub(crate) combo: String, pub(crate) description: String, + /// `false` when the config binds this combo but the compositor does not + /// actually intercept it - see `srdwm_core::KeyBinding::grabbed`. A UI + /// listing bindings should say so rather than showing a shortcut that + /// silently does nothing. + pub(crate) grabbed: bool, } #[derive(Serialize)] |