From 405d9a3e431b01a221be65f41bccb6c80c43b0a4 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 11 Jan 2008 21:19:58 -0500 Subject: dont reparse the config file when the keyboard map changes. just rebind everything. yay for mika as inspiration --- openbox/keytree.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'openbox/keytree.c') 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; -- cgit v1.2.3