all repos — openbox @ 8c68c9ab0f75514ee4f0336e566ac2c02ac20b65

openbox fork - make it a bit more like ryudo

fixes for new keybindings stuff/chroot/parsing
Dana Jansens danakj@orodu.net
commit

8c68c9ab0f75514ee4f0336e566ac2c02ac20b65

parent

b6d2529acb6e31efbf8c7791e44905a1712da891

4 files changed, 28 insertions(+), 14 deletions(-)

jump to
M openbox/action.copenbox/action.c

@@ -893,6 +893,11 @@ action_growtoedge,

setup_action_growtoedge_east }, { + "breakchroot", + action_break_chroot, + NULL + }, + { NULL, NULL, NULL

@@ -1899,3 +1904,9 @@ void action_unshow_desktop(union ActionData *data)

{ screen_show_desktop(FALSE); } + +void action_break_chroot(union ActionData *data) +{ + /* break out of one chroot */ + keyboard_reset_chains(1); +}
M openbox/action.hopenbox/action.h

@@ -341,5 +341,7 @@ /* Any */

void action_show_desktop(union ActionData *data); /* Any */ void action_unshow_desktop(union ActionData *data); +/* Any */ +void action_break_chroot(union ActionData *data); #endif
M openbox/config.copenbox/config.c

@@ -278,6 +278,7 @@ gboolean is_chroot = FALSE;

if (!parse_attr_string("key", node, &key)) return; + parse_attr_bool("chroot", node, &is_chroot); keylist = g_list_append(keylist, key);

@@ -304,9 +305,6 @@ keyboard_chroot(keylist);

g_free(key); keylist = g_list_delete_link(keylist, g_list_last(keylist)); - - /* go to next sibling */ - if (node->next) parse_key(i, doc, node->next, keylist); } static void parse_keyboard(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,

@@ -325,7 +323,10 @@ g_free(key);

} if ((n = parse_find_node("keybind", node->children))) - parse_key(i, doc, n, NULL); + while (n) { + parse_key(i, doc, n, NULL); + n = parse_find_node("keybind", n->next); + } } /*
M openbox/keytree.copenbox/keytree.c

@@ -133,16 +133,16 @@ }

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;