]> git.mdlowis.com Git - proto/labwc.git/commit
src/config/keybind.c: fix keybind insertion order
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Fri, 3 Jun 2022 20:40:26 +0000 (22:40 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Fri, 3 Jun 2022 21:54:32 +0000 (22:54 +0100)
commit39cdba36a8520c9b53e2ee2163d832e08004e5d2
tree7c4925d07d9831848133c5d7630c9770afae8ebf
parent986ab70780efd3e4f16f139e4a11d50d75e8ca5a
src/config/keybind.c: fix keybind insertion order

This restores the intended behavior of keybinds set by `<default />`
to be overwritten by manually configured keybinds which come later in
the config.

In `src/keyboard.c`, `handle_keybinding()` is going backwards through
the list of keybindings and breaks after the first match.

`wl_list_insert(&list_node, item)` will insert the new item *after* the
list_node so if its called multiple times with the same list_node as
fist argument the result will be a reversed list. Using `list_node.prev`
instead will result in a non-reversed list.
src/config/keybind.c