summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-06 22:04:55 +0000
committerDana Jansens <danakj@orodu.net>2007-05-06 22:04:55 +0000
commit6cd5f7ea380e155dbd7b29f01dd3fcfb5858ad61 (patch)
treef8910c9c2d387ea823a12833f62b335b4a09ae5d /openbox
parentc51373c20148422f1fd35a748c3cf18826496034 (diff)
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.
Diffstat (limited to 'openbox')
-rw-r--r--openbox/client.c2
-rw-r--r--openbox/config.c103
2 files changed, 55 insertions, 50 deletions
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;
<position>
<x>700</x>
<y>0</y>
+ <head>1</head>
</position>
- <head>1</head>
</application>
</applications>
*/
@@ -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);
}
}