* Change xml parsing to pass the parent node, rather than the first child. * Add x,y co-ordinates on showmenu action so we can place menus on keypress.
Scott Moynes smoynes@nexus.carleton.ca
7 files changed,
47 insertions(+),
13 deletions(-)
M
openbox/config.c
→
openbox/config.c
@@ -28,6 +28,8 @@ static void parse_focus(xmlDocPtr doc, xmlNodePtr node, void *d)
{ xmlNodePtr n; + node = node->xmlChildrenNode; + if ((n = parse_find_node("focusNew", node))) config_focus_new = parse_bool(doc, n); if ((n = parse_find_node("followMouse", node)))@@ -44,6 +46,8 @@ static void parse_theme(xmlDocPtr doc, xmlNodePtr node, void *d)
{ xmlNodePtr n; + node = node->xmlChildrenNode; + if ((n = parse_find_node("theme", node))) { g_free(config_theme); config_theme = parse_string(doc, n);@@ -54,6 +58,8 @@ static void parse_desktops(xmlDocPtr doc, xmlNodePtr node, void *d)
{ xmlNodePtr n; + node = node->xmlChildrenNode; + if ((n = parse_find_node("number", node))) config_desktops_num = parse_int(doc, n); if ((n = parse_find_node("names", node))) {@@ -78,6 +84,8 @@ static void parse_moveresize(xmlDocPtr doc, xmlNodePtr node, void *d)
{ xmlNodePtr n; + node = node->xmlChildrenNode; + if ((n = parse_find_node("opaqueMove", node))) config_opaque_move = parse_bool(doc, n); if ((n = parse_find_node("opaqueResize", node)))@@ -87,6 +95,8 @@
static void parse_dock(xmlDocPtr doc, xmlNodePtr node, void *d) { xmlNodePtr n; + + node = node->xmlChildrenNode; if ((n = parse_find_node("position", node))) { if (parse_contains("TopLeft", doc, n))
M
parser/parse.c
→
parser/parse.c
@@ -100,7 +100,7 @@ while (node) {
struct Callback *c = g_hash_table_lookup(callbacks, node->name); if (c) - c->func(doc, node->xmlChildrenNode, c->data); + c->func(doc, node, c->data); node = node->next; }
M
plugins/keyboard/keyboard.c
→
plugins/keyboard/keyboard.c
@@ -69,7 +69,7 @@ }
static void parse_xml(xmlDocPtr doc, xmlNodePtr node, void *d) { - parse_key(doc, node, NULL); + parse_key(doc, node->xmlChildrenNode, NULL); } void plugin_setup_config()@@ -247,6 +247,11 @@
if (act->func == action_cycle_windows && !grabbed_key && grab_keyboard(TRUE)) { grabbed_key = p; + } + + if (act->func == action_showmenu) { + act->data.showmenu.x = e->data.x.e->xkey.x_root; + act->data.showmenu.y = e->data.x.e->xkey.y_root; } act->data.any.c = focus_client;
M
plugins/mouse/mouse.c
→
plugins/mouse/mouse.c
@@ -31,6 +31,8 @@ char *contextstr;
MouseAction mact; Action *action; + node = node->xmlChildrenNode; + if ((n = parse_find_node("dragThreshold", node))) threshold = parse_int(doc, n); if ((n = parse_find_node("doubleClickTime", node)))
M
plugins/placement/history.c
→
plugins/placement/history.c
@@ -181,7 +181,7 @@
xmlIndentTreeOutput = 1; xmlSaveFormatFile(history_path, doc, 1); - xmlFree(doc); + xmlFreeDoc(doc); } static void load_history()@@ -236,7 +236,7 @@ }
g_free(name); g_free(class); g_free(role); node = parse_find_node("entry", node->next); } - xmlFree(doc); + xmlFreeDoc(doc); } void history_startup()