]> Dogcows Code - chaz/openbox/blobdiff - openbox/config.c
dont use obsolete xmlChildrenNode
[chaz/openbox] / openbox / config.c
index e2ca29f7da4b1d682a59846bb8c67f456f6fc34f..61b786fb4b8a4cda2361523094077256146b37ff 100644 (file)
@@ -71,7 +71,7 @@ static void parse_key(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
         if (parse_attr_string("key", n, &key)) {
             keylist = g_list_append(keylist, key);
 
-            parse_key(i, doc, n->xmlChildrenNode, keylist);
+            parse_key(i, doc, n->children, keylist);
 
             it = g_list_last(keylist);
             g_free(it->data);
@@ -82,20 +82,9 @@ static void parse_key(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
     if (keylist) {
         nact = parse_find_node("action", node);
         while (nact) {
-            if ((action = action_parse(i, doc, nact))) {
-                /* validate that its okay for a key binding */
-                if (action->func == action_moveresize &&
-                    action->data.moveresize.corner !=
-                    prop_atoms.net_wm_moveresize_move_keyboard &&
-                    action->data.moveresize.corner !=
-                    prop_atoms.net_wm_moveresize_size_keyboard) {
-                    action_free(action);
-                    action = NULL;
-                }
-
-                if (action)
-                    keyboard_bind(keylist, action);
-            }
+            if ((action = action_parse(i, doc, nact,
+                                       OB_USER_ACTION_KEYBOARD_KEY)))
+                keyboard_bind(keylist, action);
             nact = parse_find_node("action", nact->next);
         }
     }
@@ -104,7 +93,7 @@ static void parse_key(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
 static void parse_keyboard(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
                            void *d)
 {
-    parse_key(i, doc, node->xmlChildrenNode, NULL);
+    parse_key(i, doc, node->children, NULL);
 }
 
 /*
@@ -123,10 +112,11 @@ static void parse_mouse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
     xmlNodePtr n, nbut, nact;
     char *buttonstr;
     char *contextstr;
+    ObUserAction uact;
     ObMouseAction mact;
     ObAction *action;
 
-    node = node->xmlChildrenNode;
+    node = node->children;
     
     if ((n = parse_find_node("dragThreshold", node)))
         config_mouse_threshold = parse_int(doc, n);
@@ -137,48 +127,31 @@ static void parse_mouse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
     while (n) {
         if (!parse_attr_string("name", n, &contextstr))
             goto next_n;
-        nbut = parse_find_node("mousebind", n->xmlChildrenNode);
+        nbut = parse_find_node("mousebind", n->children);
         while (nbut) {
             if (!parse_attr_string("button", nbut, &buttonstr))
                 goto next_nbut;
-            if (parse_attr_contains("press", nbut, "action"))
+            if (parse_attr_contains("press", nbut, "action")) {
+                uact = OB_USER_ACTION_MOUSE_PRESS;
                 mact = OB_MOUSE_ACTION_PRESS;
-            else if (parse_attr_contains("release", nbut, "action"))
+            } else if (parse_attr_contains("release", nbut, "action")) {
+                uact = OB_USER_ACTION_MOUSE_RELEASE;
                 mact = OB_MOUSE_ACTION_RELEASE;
-            else if (parse_attr_contains("click", nbut, "action"))
+            } else if (parse_attr_contains("click", nbut, "action")) {
+                uact = OB_USER_ACTION_MOUSE_CLICK;
                 mact = OB_MOUSE_ACTION_CLICK;
-            else if (parse_attr_contains("doubleclick", nbut,"action"))
+            } else if (parse_attr_contains("doubleclick", nbut,"action")) {
+                uact = OB_USER_ACTION_MOUSE_DOUBLE_CLICK;
                 mact = OB_MOUSE_ACTION_DOUBLE_CLICK;
-            else if (parse_attr_contains("drag", nbut, "action"))
+            } else if (parse_attr_contains("drag", nbut, "action")) {
+                uact = OB_USER_ACTION_MOUSE_MOTION;
                 mact = OB_MOUSE_ACTION_MOTION;
-            else
+            else
                 goto next_nbut;
-            nact = parse_find_node("action", nbut->xmlChildrenNode);
+            nact = parse_find_node("action", nbut->children);
             while (nact) {
-                if ((action = action_parse(i, doc, nact))) {
-                    /* validate that its okay for a mouse binding*/
-                    if (mact == OB_MOUSE_ACTION_MOTION) {
-                        if (action->func != action_moveresize ||
-                            action->data.moveresize.corner ==
-                            prop_atoms.net_wm_moveresize_move_keyboard ||
-                            action->data.moveresize.corner ==
-                            prop_atoms.net_wm_moveresize_size_keyboard) {
-                            action_free(action);
-                            action = NULL;
-                        }
-                    } else {
-                        if (action->func == action_moveresize &&
-                            action->data.moveresize.corner !=
-                            prop_atoms.net_wm_moveresize_move_keyboard &&
-                            action->data.moveresize.corner !=
-                            prop_atoms.net_wm_moveresize_size_keyboard) {
-                            action_free(action);
-                            action = NULL;
-                        }
-                    }
-                    if (action)
-                        mouse_bind(buttonstr, contextstr, mact, action);
-                }
+                if ((action = action_parse(i, doc, nact, uact)))
+                    mouse_bind(buttonstr, contextstr, mact, action);
                 nact = parse_find_node("action", nact->next);
             }
             g_free(buttonstr);
@@ -196,7 +169,7 @@ static void parse_focus(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
 {
     xmlNodePtr n;
 
-    node = node->xmlChildrenNode;
+    node = node->children;
     
     if ((n = parse_find_node("focusNew", node)))
         config_focus_new = parse_bool(doc, n);
@@ -215,7 +188,7 @@ static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
 {
     xmlNodePtr n;
 
-    node = node->xmlChildrenNode;
+    node = node->children;
 
     if ((n = parse_find_node("name", node))) {
         gchar *c;
@@ -236,7 +209,7 @@ static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
 {
     xmlNodePtr n;
 
-    node = node->xmlChildrenNode;
+    node = node->children;
     
     if ((n = parse_find_node("number", node)))
         config_desktops_num = parse_int(doc, n);
@@ -249,7 +222,7 @@ static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
         g_slist_free(config_desktops_names);
         config_desktops_names = NULL;
 
-        nname = parse_find_node("name", n->xmlChildrenNode);
+        nname = parse_find_node("name", n->children);
         while (nname) {
             config_desktops_names = g_slist_append(config_desktops_names,
                                                    parse_string(doc, nname));
@@ -263,7 +236,7 @@ static void parse_resize(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
 {
     xmlNodePtr n;
 
-    node = node->xmlChildrenNode;
+    node = node->children;
     
     if ((n = parse_find_node("drawContents", node)))
         config_redraw_resize = parse_bool(doc, n);
@@ -273,7 +246,7 @@ static void parse_dock(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, void *d)
 {
     xmlNodePtr n;
 
-    node = node->xmlChildrenNode;
+    node = node->children;
 
     if ((n = parse_find_node("position", node))) {
         if (parse_contains("TopLeft", doc, n))
@@ -331,7 +304,7 @@ static void parse_dock(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, void *d)
 
 static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, void *d)
 {
-    for (node = node->xmlChildrenNode; node; node = node->next) {
+    for (node = node->children; node; node = node->next) {
         if (!xmlStrcasecmp(node->name, (const xmlChar*) "file")) {
             gchar *c;
 
@@ -348,7 +321,7 @@ static void parse_resistance(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
 {
     xmlNodePtr n;
 
-    node = node->xmlChildrenNode;
+    node = node->children;
     if ((n = parse_find_node("strength", node)))
         config_resist_win = parse_int(doc, n);
     if ((n = parse_find_node("screen_edge_strength", node)))
@@ -361,7 +334,7 @@ void config_startup(ObParseInst *i)
     config_focus_follow = FALSE;
     config_focus_last = TRUE;
     config_focus_last_on_desktop = TRUE;
-    config_focus_delay = 150000;
+    config_focus_delay = 0;
 
     parse_register(i, "focus", parse_focus, NULL);
 
This page took 0.026555 seconds and 4 git commands to generate.