diff options
| author | Dana Jansens <danakj@orodu.net> | 2008-01-11 21:19:58 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2008-01-11 21:19:58 -0500 |
| commit | 405d9a3e431b01a221be65f41bccb6c80c43b0a4 (patch) | |
| tree | 753ee1e167be50ba6d9d26cecf52bd47a737e29d /openbox/keytree.c | |
| parent | c2e495c720d93521bdb0e1bfd7e76584a1b329b7 (diff) | |
dont reparse the config file when the keyboard map changes. just rebind everything. yay for mika as inspiration
Diffstat (limited to 'openbox/keytree.c')
| -rw-r--r-- | openbox/keytree.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/openbox/keytree.c b/openbox/keytree.c index fb26624d..714fffda 100644 --- a/openbox/keytree.c +++ b/openbox/keytree.c @@ -63,14 +63,18 @@ KeyBindingTree *tree_build(GList *keylist) g_strdup(kit->data)); /* deep copy */ ret->first_child = p; if (p != NULL) p->parent = ret; - if (!translate_key(it->data, &ret->state, &ret->key)) { - tree_destroy(ret); - return NULL; - } + translate_key(it->data, &ret->state, &ret->key); } return ret; } +void tree_rebind(KeyBindingTree *node) { + GList *it = g_list_last(node->keylist); + translate_key(it->data, &node->state, &node->key); + if (node->next_sibling) tree_rebind(node->next_sibling); + if (node->first_child) tree_rebind(node->first_child); +} + void tree_assimilate(KeyBindingTree *node) { KeyBindingTree *a, *b, *tmp, *last; |
