X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fkeytree.c;h=202dd32c9864e55c1623c7b04852bbcead34e871;hb=9c32f34b3766de01c51bc5d00c17d68804ab2603;hp=b26a4da7dac41cbe6e295cd9b915374f1137cb69;hpb=b6d2529acb6e31efbf8c7791e44905a1712da891;p=chaz%2Fopenbox diff --git a/openbox/keytree.c b/openbox/keytree.c index b26a4da7..202dd32c 100644 --- a/openbox/keytree.c +++ b/openbox/keytree.c @@ -133,16 +133,16 @@ KeyBindingTree *tree_find(KeyBindingTree *search, gboolean *conflict) gboolean tree_chroot(KeyBindingTree *tree, GList *keylist) { - if (keylist == NULL) { - tree->chroot = TRUE; - return TRUE; - } else { - guint key, state; - if (translate_key(keylist->data, &state, &key)) { - while (tree != NULL && !(tree->state == state && tree->key == key)) - tree = tree->next_sibling; - if (tree != NULL) - return tree_chroot(tree, keylist->next); + guint key, state; + if (translate_key(keylist->data, &state, &key)) { + while (tree != NULL && !(tree->state == state && tree->key == key)) + tree = tree->next_sibling; + if (tree != NULL) { + if (keylist->next == NULL) { + tree->chroot = TRUE; + return TRUE; + } else + return tree_chroot(tree->first_child, keylist->next); } } return FALSE;