summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-04-26 02:10:15 +0000
committerDana Jansens <danakj@orodu.net>2007-04-26 02:10:15 +0000
commit8c68c9ab0f75514ee4f0336e566ac2c02ac20b65 (patch)
tree8dd8bc2a3cf2d0a8e7faa7ca6d6076ad48e8fcce /openbox
parentb6d2529acb6e31efbf8c7791e44905a1712da891 (diff)
fixes for new keybindings stuff/chroot/parsing
Diffstat (limited to 'openbox')
-rw-r--r--openbox/action.c11
-rw-r--r--openbox/action.h2
-rw-r--r--openbox/config.c9
-rw-r--r--openbox/keytree.c20
4 files changed, 28 insertions, 14 deletions
diff --git a/openbox/action.c b/openbox/action.c
index 556fc225..50a90130 100644
--- a/openbox/action.c
+++ b/openbox/action.c
@@ -893,6 +893,11 @@ ActionString actionstrings[] =
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);
+}
diff --git a/openbox/action.h b/openbox/action.h
index 40391460..c4c06fa8 100644
--- a/openbox/action.h
+++ b/openbox/action.h
@@ -341,5 +341,7 @@ void action_toggle_show_desktop(union ActionData *data);
void action_show_desktop(union ActionData *data);
/* Any */
void action_unshow_desktop(union ActionData *data);
+/* Any */
+void action_break_chroot(union ActionData *data);
#endif
diff --git a/openbox/config.c b/openbox/config.c
index aadc4389..2ed6921e 100644
--- a/openbox/config.c
+++ b/openbox/config.c
@@ -278,6 +278,7 @@ static void parse_key(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
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 @@ static void parse_key(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
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 @@ static void parse_keyboard(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
}
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);
+ }
}
/*
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;