ObPlacePolicy config_place_policy;
gboolean config_place_center;
+StrutPartial config_margins;
+
gchar *config_theme;
gboolean config_theme_keepborder;
if (class_set || name_set) {
xmlNodePtr n, c;
ObAppSettings *settings = config_create_app_settings();;
-
+
if (name_set)
settings->name = g_pattern_spec_new(name);
if ((c = parse_find_node("x", n->children)))
if (!parse_contains("default", doc, c)) {
gchar *s = parse_string(doc, c);
- if (!strcmp(s, "center")) {
+ if (!g_ascii_strcasecmp(s, "center")) {
settings->center_x = TRUE;
x_pos_given = TRUE;
} else {
if (x_pos_given && (c = parse_find_node("y", n->children)))
if (!parse_contains("default", doc, c)) {
gchar *s = parse_string(doc, c);
- if (!strcmp(s, "center")) {
+ if (!g_ascii_strcasecmp(s, "center")) {
settings->center_y = TRUE;
settings->pos_given = TRUE;
} else {
(c = parse_find_node("monitor", n->children)))
if (!parse_contains("default", doc, c)) {
gchar *s = parse_string(doc, c);
- if (!strcmp(s, "mouse"))
+ if (!g_ascii_strcasecmp(s, "mouse"))
settings->monitor = 0;
else
settings->monitor = parse_int(doc, c) + 1;
if ((n = parse_find_node("desktop", app->children))) {
if (!parse_contains("default", doc, n)) {
gchar *s = parse_string(doc, n);
- if (!strcmp(s, "all"))
+ if (!g_ascii_strcasecmp(s, "all"))
settings->desktop = DESKTOP_ALL;
else {
gint i = parse_int(doc, n);
if ((n = parse_find_node("layer", app->children)))
if (!parse_contains("default", doc, n)) {
gchar *s = parse_string(doc, n);
- if (!strcmp(s, "above"))
+ if (!g_ascii_strcasecmp(s, "above"))
settings->layer = 1;
- else if (!strcmp(s, "below"))
+ else if (!g_ascii_strcasecmp(s, "below"))
settings->layer = -1;
else
settings->layer = 0;
if ((n = parse_find_node("maximized", app->children)))
if (!parse_contains("default", doc, n)) {
gchar *s = parse_string(doc, n);
- if (!strcmp(s, "horizontal")) {
+ if (!g_ascii_strcasecmp(s, "horizontal")) {
settings->max_horz = TRUE;
settings->max_vert = FALSE;
- } else if (!strcmp(s, "vertical")) {
+ } else if (!g_ascii_strcasecmp(s, "vertical")) {
settings->max_horz = FALSE;
settings->max_vert = TRUE;
} else
config_per_app_settings = g_slist_append(config_per_app_settings,
(gpointer) settings);
}
-
+
app = parse_find_node("application", app->next);
}
else if ((n = parse_find_node("action", node->children))) {
while (n) {
ObActionsAct *action;
-
+
action = actions_parse(i, doc, n);
if (action)
keyboard_bind(keylist, action);
/*
-<context name="Titlebar">
+<context name="Titlebar">
<mousebind button="Left" action="Press">
<action name="Raise"></action>
</mousebind>
mouse_unbind_all();
node = node->children;
-
+
if ((n = parse_find_node("dragThreshold", node)))
config_mouse_threshold = parse_int(doc, n);
if ((n = parse_find_node("doubleClickTime", node)))
xmlNodePtr n;
node = node->children;
-
+
if ((n = parse_find_node("focusNew", node)))
config_focus_new = parse_bool(doc, n);
if ((n = parse_find_node("followMouse", node)))
xmlNodePtr n;
node = node->children;
-
+
if ((n = parse_find_node("policy", node)))
if (parse_contains("UnderMouse", doc, n))
config_place_policy = OB_PLACE_POLICY_MOUSE;
config_place_center = parse_bool(doc, n);
}
+static void parse_margins(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
+ gpointer d)
+{
+ xmlNodePtr n;
+
+ node = node->children;
+
+ if ((n = parse_find_node("top", node)))
+ config_margins.top = MAX(0, parse_int(doc, n));
+ if ((n = parse_find_node("left", node)))
+ config_margins.left = MAX(0, parse_int(doc, n));
+ if ((n = parse_find_node("right", node)))
+ config_margins.right = MAX(0, parse_int(doc, n));
+ if ((n = parse_find_node("bottom", node)))
+ config_margins.bottom = MAX(0, parse_int(doc, n));
+}
+
static void parse_theme(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
gpointer d)
{
xmlNodePtr n;
node = node->children;
-
+
if ((n = parse_find_node("number", node))) {
gint d = parse_int(doc, n);
if (d > 0)
xmlNodePtr n;
node = node->children;
-
+
if ((n = parse_find_node("drawContents", node)))
config_resize_redraw = parse_bool(doc, n);
if ((n = parse_find_node("popupShow", node))) {
config_menu_client_list_icons = parse_bool(doc, n);
}
}
-
-static void parse_resistance(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
+
+static void parse_resistance(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
gpointer d)
{
xmlNodePtr n;
const gchar *actname;
} ObDefKeyBind;
+static void bind_default_keyboard()
+{
+ ObDefKeyBind *it;
+ ObDefKeyBind binds[] = {
+ { "A-Tab", "NextWindow" },
+ { "S-A-Tab", "PreviousWindow" },
+ { "A-F4", "Close" },
+ { NULL, NULL }
+ };
+ for (it = binds; it->key; ++it) {
+ GList *l = g_list_append(NULL, g_strdup(it->key));
+ keyboard_bind(l, actions_parse_string(it->actname));
+ }
+}
+
typedef struct
{
const gchar *button;
{ "Left", "AllDesktops", OB_MOUSE_ACTION_CLICK, "Raise" },
{ "Left", "Shade", OB_MOUSE_ACTION_CLICK, "Raise" },
{ "Left", "Close", OB_MOUSE_ACTION_CLICK, "Close" },
- { "Left", "Maximize", OB_MOUSE_ACTION_CLICK, "Maximize" },
+ { "Left", "Maximize", OB_MOUSE_ACTION_CLICK, "ToggleMaximize" },
{ "Left", "Iconify", OB_MOUSE_ACTION_CLICK, "Iconify" },
- { "Left", "AllDesktops", OB_MOUSE_ACTION_CLICK, "Omnipresent" },
- { "Left", "Shade", OB_MOUSE_ACTION_CLICK, "Shade" },
+ { "Left", "AllDesktops", OB_MOUSE_ACTION_CLICK, "ToggleOmnipresent" },
+ { "Left", "Shade", OB_MOUSE_ACTION_CLICK, "ToggleShade" },
{ "Left", "TLCorner", OB_MOUSE_ACTION_MOTION, "Resize" },
{ "Left", "TRCorner", OB_MOUSE_ACTION_MOTION, "Resize" },
{ "Left", "BLCorner", OB_MOUSE_ACTION_MOTION, "Resize" },
{ "Left", "BRCorner", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { "Left", "Top", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { "Left", "Bottom", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { "Left", "Left", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { "Left", "Right", OB_MOUSE_ACTION_MOTION, "Resize" },
{ "Left", "Titlebar", OB_MOUSE_ACTION_MOTION, "Move" },
{ "A-Left", "Frame", OB_MOUSE_ACTION_MOTION, "Move" },
{ "A-Middle", "Frame", OB_MOUSE_ACTION_MOTION, "Resize" },
parse_register(i, "placement", parse_placement, NULL);
+ STRUT_PARTIAL_SET(config_margins, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+ parse_register(i, "margins", parse_margins, NULL);
+
config_theme = NULL;
config_animate_iconify = TRUE;
translate_key("C-g", &config_keyboard_reset_state,
&config_keyboard_reset_keycode);
+ bind_default_keyboard();
+
parse_register(i, "keyboard", parse_keyboard, NULL);
config_mouse_threshold = 8;