From 6cd5f7ea380e155dbd7b29f01dd3fcfb5858ad61 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 6 May 2007 22:04:55 +0000 Subject: [PATCH] document the per app settings in rc.xml.in. some xsd fixes. add the "default" option to all the per-app settings which is the same as not putting it in there at all. --- data/rc.xml.in | 67 +++++++++++++++++++++++++----- data/rc.xsd | 14 +++---- openbox/client.c | 2 +- openbox/config.c | 103 +++++++++++++++++++++++++---------------------- 4 files changed, 117 insertions(+), 69 deletions(-) diff --git a/data/rc.xml.in b/data/rc.xml.in index be2b806d..45e144a3 100644 --- a/data/rc.xml.in +++ b/data/rc.xml.in @@ -47,32 +47,47 @@ sans 7 + bold + normal + sans 7 + bold + normal + sans 8 + bold + normal + sans 9 + bold + normal + sans 9 + bold + normal + @@ -408,38 +423,68 @@ menu.xml - yes - yes 250 no 0 - yes - + yes + - + + + + yes + no + + center + 200 + + 0 + + yes + + 1 - 0 - # specifies xinerama head + + normal - # 'above', 'normal', or 'below' + + no + no + + no + + yes + true - # 'Horizontal', 'Vertical' or boolean (yes/no/on/off/true/false) + - --> + --> diff --git a/data/rc.xsd b/data/rc.xsd index 01fd525c..d3df567d 100644 --- a/data/rc.xsd +++ b/data/rc.xsd @@ -199,24 +199,22 @@ - - - + + - + - @@ -434,9 +432,9 @@ - - - + + + diff --git a/openbox/client.c b/openbox/client.c index cbd42ef4..374ad404 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -639,13 +639,13 @@ static ObAppSettings *client_get_settings_state(ObClient *self) || (app->class && app->name && !strcmp(app->class, self->class) && !strcmp(app->name, self->name))) { - ob_debug("Window matching: %s\n", app->name); /* Match if no role was specified in the per app setting, or if the * string matches the beginning of the role, since apps like to set * the role to things like browser-window-23c4b2f */ if (!app->role || !strncmp(app->role, self->role, strlen(app->role))) { + ob_debug("Window matching: %s\n", app->name); /* use this one */ settings = app; break; diff --git a/openbox/config.c b/openbox/config.c index 367fb2f9..f18b77c9 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -102,8 +102,8 @@ GSList *config_per_app_settings; 700 0 + 1 - 1 */ @@ -151,64 +151,71 @@ static void parse_per_app_settings(ObParseInst *i, xmlDocPtr doc, settings->decor = -1; if ((n = parse_find_node("decor", app->children))) - settings->decor = parse_bool(doc, n); + if (!parse_contains("default", doc, n)) + settings->decor = parse_bool(doc, n); settings->shade = -1; if ((n = parse_find_node("shade", app->children))) - settings->shade = parse_bool(doc, n); + if (!parse_contains("default", doc, n)) + settings->shade = parse_bool(doc, n); settings->position.x = settings->position.y = 0; settings->pos_given = FALSE; if ((n = parse_find_node("position", app->children))) { - if ((c = parse_find_node("x", n->children))) { - gchar *s = parse_string(doc, c); - if (!strcmp(s, "center")) { - settings->center_x = TRUE; - x_pos_given = TRUE; - } else { - settings->position.x = parse_int(doc, c); - x_pos_given = TRUE; + if ((c = parse_find_node("x", n->children))) + if (!parse_contains("default", doc, c)) { + gchar *s = parse_string(doc, c); + if (!strcmp(s, "center")) { + settings->center_x = TRUE; + x_pos_given = TRUE; + } else { + settings->position.x = parse_int(doc, c); + x_pos_given = TRUE; + } + g_free(s); } - g_free(s); - } - - if (x_pos_given && (c = parse_find_node("y", n->children))) { - gchar *s = parse_string(doc, c); - if (!strcmp(s, "center")) { - settings->center_y = TRUE; - settings->pos_given = TRUE; - } else { - settings->position.y = parse_int(doc, c); - settings->pos_given = TRUE; + + if (x_pos_given && (c = parse_find_node("y", n->children))) + if (!parse_contains("default", doc, )) { + gchar *s = parse_string(doc, c); + if (!strcmp(s, "center")) { + settings->center_y = TRUE; + settings->pos_given = TRUE; + } else { + settings->position.y = parse_int(doc, c); + settings->pos_given = TRUE; + } + g_free(s); + } + + if (settings->pos_given && + (c = parse_find_node("head", n->children))) + if (!parse_contains("default", doc, n)) { + gchar *s = parse_string(doc, n); + if (!strcmp(s, "mouse")) + settings->head = -1; + else + settings->head = parse_int(doc, n); + g_free(s); } - g_free(s); - } } settings->focus = -1; if ((n = parse_find_node("focus", app->children))) - settings->focus = parse_bool(doc, n); - - if ((n = parse_find_node("desktop", app->children))) { - gchar *s = parse_string(doc, n); - if (!strcmp(s, "all")) - settings->desktop = DESKTOP_ALL; - else - settings->desktop = parse_int(doc, n); - g_free(s); - } else - settings->desktop = DESKTOP_ALL - 1; /* lets hope the user - * doesn't have 2^32 - * desktops */ - - if ((n = parse_find_node("head", app->children))) { - gchar *s = parse_string(doc, n); - if (!strcmp(s, "mouse")) - settings->head = -1; - else - settings->head = parse_int(doc, n); - g_free(s); - } + if (!parse_contains("default", doc, n)) + settings->focus = parse_bool(doc, n); + + if ((n = parse_find_node("desktop", app->children))) + if (!parse_contains("default", doc, n)) { + gchar *s = parse_string(doc, n); + if (!strcmp(s, "all")) + settings->desktop = DESKTOP_ALL; + else + settings->desktop = parse_int(doc, n); + g_free(s); + } else + /* lets hope the user doesn't have 2^32 desktops */ + settings->desktop = DESKTOP_ALL - 1; settings->layer = -2; if ((n = parse_find_node("layer", app->children))) { @@ -663,15 +670,13 @@ static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, parse_expand_tilde(c)); g_free(c); } - if ((n = parse_find_node("warpPointer", node))) - config_menu_warppointer = parse_bool(doc, n); if ((n = parse_find_node("hideDelay", node))) config_menu_hide_delay = parse_int(doc, n); if ((n = parse_find_node("middle", node))) config_menu_middle = parse_bool(doc, n); if ((n = parse_find_node("submenuShowDelay", node))) config_submenu_show_delay = parse_int(doc, n); - if ((n = parse_find_node("desktopMenuIcons", node))) + if ((n = parse_find_node("applicationIcons", node))) config_menu_client_list_icons = parse_bool(doc, n); } } -- 2.45.2