gboolean config_unfocus_leave;
ObPlacePolicy config_place_policy;
+gboolean config_place_center;
ObPlaceMonitor config_place_monitor;
guint config_primary_monitor_index;
/* monitor is copied above */
}
- if (src->size_given) {
- dst->size_given = TRUE;
- dst->width_num = src->width_num;
- dst->width_denom = src->width_denom;
- dst->height_num = src->height_num;
- dst->height_denom = src->height_denom;
- }
+ dst->width_num = src->width_num;
+ dst->width_denom = src->width_denom;
+ dst->height_num = src->height_num;
+ dst->height_denom = src->height_denom;
}
void config_parse_relative_number(gchar *s, gint *num, gint *denom)
{
xmlNodePtr n, c;
gboolean x_pos_given = FALSE;
- gboolean width_given = FALSE;
if ((n = obt_xml_find_node(app->children, "decor")))
if (!obt_xml_node_contains(n, "default"))
config_parse_relative_number(s,
&settings->width_num,
&settings->width_denom);
- if (settings->width_num > 0 && settings->width_denom >= 0)
- width_given = TRUE;
+ if (settings->width_num <= 0 || settings->width_denom < 0)
+ settings->width_num = settings->width_denom = 0;
g_free(s);
}
}
- if (width_given && (c = obt_xml_find_node(n->children, "height"))) {
- gchar *s = obt_xml_node_string(c);
- config_parse_relative_number(s,
- &settings->height_num,
- &settings->height_denom);
- if (settings->height_num > 0 && settings->height_denom >= 0)
- settings->size_given = TRUE;
- g_free(s);
+ if ((c = obt_xml_find_node(n->children, "height"))) {
+ if (!obt_xml_node_contains(c, "default")) {
+ gchar *s = obt_xml_node_string(c);
+ config_parse_relative_number(s,
+ &settings->height_num,
+ &settings->height_denom);
+ if (settings->height_num <= 0 || settings->height_denom < 0)
+ settings->height_num = settings->height_denom = 0;
+ g_free(s);
+ }
}
}
gchar *keystring, **keys, **key;
xmlNodePtr n;
gboolean is_chroot = FALSE;
+ gboolean grab = TRUE;
if (!obt_xml_attr_string(node, "key", &keystring))
return;
obt_xml_attr_bool(node, "chroot", &is_chroot);
+ obt_xml_attr_bool(node, "grab", &grab);
keys = g_strsplit(keystring, " ", 0);
for (key = keys; *key; ++key) {
action = actions_parse(n);
if (action)
- keyboard_bind(keylist, action);
+ keyboard_bind(keylist, action, grab);
n = obt_xml_find_node(n->next, "action");
}
}
while (nact) {
ObActionsAct *action;
- if ((action = actions_parse(nact)))
- mouse_bind(buttonstr, cx, mact, action);
+ if ((action = actions_parse(nact))) {
+ gchar *p = buttonstr;
+ while (*p) {
+ gchar *s = strchr(p, ' ');
+ if (s) {
+ *s = '\0';
+ } else {
+ s = p;
+ while (*++s);
+ s--;
+ }
+ mouse_bind(p, cx, mact, action);
+ actions_act_ref(action); /* ref the action for each binding */
+ p = s+1;
+ }
+ actions_act_unref(action); /* remove the extra ref */
+ }
nact = obt_xml_find_node(nact->next, "action");
}
g_free(buttonstr);
node = node->children;
- if ((n = obt_xml_find_node(node, "policy")))
+ if ((n = obt_xml_find_node(node, "policy"))) {
if (obt_xml_node_contains(n, "UnderMouse"))
config_place_policy = OB_PLACE_POLICY_MOUSE;
+ }
+ if ((n = obt_xml_find_node(node, "center"))) {
+ config_place_center = obt_xml_node_bool(n);
+ }
if ((n = obt_xml_find_node(node, "monitor"))) {
if (obt_xml_node_contains(n, "active"))
config_place_monitor = OB_PLACE_MONITOR_ACTIVE;
*font = RrFontOpen(ob_rr_inst, name, size, weight, slant);
g_free(name);
+
+ if ((fnode = obt_xml_find_node(n->children, "description"))) {
+ gchar *s = obt_xml_node_string(fnode);
+ RrFontDescriptionFromString(*font, s);
+ g_free(s);
+ }
+
next_font:
n = obt_xml_find_node(n->next, "font");
}
config_menu_manage_desktops = obt_xml_node_bool(n);
if ((n = obt_xml_find_node(node, "showIcons"))) {
config_menu_show_icons = obt_xml_node_bool(n);
-#ifndef USE_IMLIB2
+#if !defined(USE_IMLIB2) && !defined(USE_LIBRSVG)
if (config_menu_show_icons)
- g_message(_("Openbox was compiled without Imlib2 image loading support. Icons in menus will not be loaded."));
+ g_message(_("Openbox was compiled without image loading support. Icons in menus will not be loaded."));
#endif
}
};
for (it = binds; it->key; ++it) {
GList *l = g_list_append(NULL, g_strdup(it->key));
- keyboard_bind(l, actions_parse_string(it->actname));
+ keyboard_bind(l, actions_parse_string(it->actname), TRUE);
}
}
obt_xml_register(i, "focus", parse_focus, NULL);
config_place_policy = OB_PLACE_POLICY_SMART;
+ config_place_center = TRUE;
config_place_monitor = OB_PLACE_MONITOR_PRIMARY;
config_primary_monitor_index = 1;