X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fmenu.c;h=286434cf09218672055ff94513c7d122b02f1a53;hb=84a60ebbfbdf9deea446c35c53f8703edeb8213d;hp=ab2294ed89790dac04f8f13765e415ff605d0c7a;hpb=8617f504a734e417e76e350977f656124bec1b51;p=chaz%2Fopenbox diff --git a/openbox/menu.c b/openbox/menu.c index ab2294ed..286434cf 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -89,13 +89,13 @@ void menu_startup(gboolean reconfig) for (it = config_menu_files; it; it = g_slist_next(it)) { if (menu_open(it->data, &doc, &node)) { loaded = TRUE; - parse_tree(menu_parse_inst, doc, node->xmlChildrenNode); + parse_tree(menu_parse_inst, doc, node->children); xmlFreeDoc(doc); } } if (!loaded) { if (menu_open("menu.xml", &doc, &node)) { - parse_tree(menu_parse_inst, doc, node->xmlChildrenNode); + parse_tree(menu_parse_inst, doc, node->children); xmlFreeDoc(doc); } } @@ -135,8 +135,7 @@ void menu_pipe_execute(ObMenu *self) if (!self->execute) return; - if (!g_spawn_command_line_sync(self->execute, &output, NULL, NULL, &err)) - { + if (!g_spawn_command_line_sync(self->execute, &output, NULL, NULL, &err)) { g_warning("Failed to execute command for pipe-menu: %s", err->message); g_error_free(err); return; @@ -150,7 +149,7 @@ void menu_pipe_execute(ObMenu *self) menu_parse_state.pipe_creator = self; menu_parse_state.parent = self; - parse_tree(menu_parse_inst, doc, node->xmlChildrenNode); + parse_tree(menu_parse_inst, doc, node->children); xmlFreeDoc(doc); } else { g_warning("Invalid output from pipe-menu: %s", self->execute); @@ -179,9 +178,11 @@ static void parse_menu_item(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, if (parse_attr_string("label", node, &label)) { GSList *acts = NULL; - for (node = node->xmlChildrenNode; node; node = node->next) + for (node = node->children; node; node = node->next) if (!xmlStrcasecmp(node->name, (const xmlChar*) "action")) - acts = g_slist_append(acts, action_parse(i, doc, node)); + acts = g_slist_append(acts, action_parse + (i, doc, node, + OB_USER_ACTION_MENU_SELECTION)); menu_add_normal(state->parent, -1, label, acts); g_free(label); } @@ -221,7 +222,7 @@ static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, old = state->parent; state->parent = menu; - parse_tree(i, doc, node->xmlChildrenNode); + parse_tree(i, doc, node->children); state->parent = old; } }