+
+ if ((n = obt_xml_find_node(node, "position"))) {
+ if ((c = obt_xml_find_node(n->children, "x"))) {
+ if (!obt_xml_node_contains(c, "default")) {
+ config_parse_gravity_coord(c, &o->x);
+ x_pos_given = TRUE;
+ }
+ }
+
+ if (x_pos_given && (c = obt_xml_find_node(n->children, "y"))) {
+ if (!obt_xml_node_contains(c, "default")) {
+ config_parse_gravity_coord(c, &o->y);
+ o->use_position = TRUE;
+ }
+ }
+
+ /* unlike client placement, x/y is needed to specify a monitor,
+ * either it's under the mouse or it's in an exact actual position */
+ if (o->use_position && (c = obt_xml_find_node(n->children, "monitor"))) {
+ if (!obt_xml_node_contains(c, "default")) {
+ gchar *s = obt_xml_node_string(c);
+ if (!g_ascii_strcasecmp(s, "mouse"))
+ o->monitor_type = OB_PLACE_MONITOR_MOUSE;
+ else if (!g_ascii_strcasecmp(s, "active"))
+ o->monitor_type = OB_PLACE_MONITOR_ACTIVE;
+ else if (!g_ascii_strcasecmp(s, "primary"))
+ o->monitor_type = OB_PLACE_MONITOR_PRIMARY;
+ else if (!g_ascii_strcasecmp(s, "all"))
+ o->monitor_type = OB_PLACE_MONITOR_ALL;
+ else
+ o->monitor = obt_xml_node_int(c) - 1;
+ g_free(s);
+ }
+ }
+ }