X.U.NamedActions: Do not discard all keybindings in addDescrKeys

Discarding keybindings may yield unintended behaviour when keybindings
are added via combinators, instead of the `keys` field.  This makes the
combinators noncommutative, which is very counterintuitive.

Related: https://old.reddit.com/r/xmonad/comments/10g1v1r/deftogglestrutskey_not_working/
This commit is contained in:
Tony Zorman
2023-01-27 20:34:43 +01:00
parent 49904ec4d3
commit 90f4a96f93
2 changed files with 7 additions and 1 deletions

View File

@@ -173,8 +173,14 @@
[polybar issue](https://github.com/polybar/polybar/issues/2603)).
* `XMonad.Hooks.StatusBar`
- Added `startAllStatusBars` to start the configured status bars.
* `XMonad.Util.NamedActions`
- Changed `addDescrKeys` and `addDescrKeys'` to not discard the
keybindings in the current config.
### Other changes
## 0.17.1 (September 3, 2022)

View File

@@ -205,7 +205,7 @@ addDescrKeys' :: (HasName b) =>
addDescrKeys' (k,f) ks conf =
let shk l = f $ [(k,f $ ks l)] ^++^ ks l
keylist l = M.map getAction $ M.fromList $ ks l ^++^ [(k, shk l)]
in conf { keys = keylist }
in conf { keys = keylist <> keys conf }
-- | A version of the default keys from the default configuration, but with
-- 'NamedAction' instead of @X ()@