]> Dogcows Code - chaz/openbox/commitdiff
fixes for new keybindings stuff/chroot/parsing
authorDana Jansens <danakj@orodu.net>
Thu, 26 Apr 2007 02:10:15 +0000 (02:10 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 26 Apr 2007 02:10:15 +0000 (02:10 +0000)
openbox/action.c
openbox/action.h
openbox/config.c
openbox/keytree.c

index 556fc22564a50e36bbdee3f21341529b2c2f9324..50a901300c2f7205081454a529e57376fd5960af 100644 (file)
@@ -892,6 +892,11 @@ ActionString actionstrings[] =
         action_growtoedge,
         setup_action_growtoedge_east
     },
+    {
+        "breakchroot",
+        action_break_chroot,
+        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);
+}
index 4039146041e6dc945b6aea1f4375364df1a32116..c4c06fa886db8fcde92d45be0bf291346de69e2f 100644 (file)
@@ -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
index aadc4389f5b7faec7439d5c8676e37d01e04c401..2ed6921e6c021046a6b8d242637584f0dd43dc84 100644 (file)
@@ -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);
+        }
 }
 
 /*
index b26a4da7dac41cbe6e295cd9b915374f1137cb69..202dd32c9864e55c1623c7b04852bbcead34e871 100644 (file)
@@ -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;
This page took 0.027234 seconds and 4 git commands to generate.