From deb0aa720a4feda3b52c17e16ed7324c61dc331a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 2 Feb 2008 16:50:55 -0500 Subject: [PATCH] allow you to force the position of windows with rc.xml's per-app settings with the force="yes" attribute --- openbox/config.c | 3 +++ openbox/config.h | 1 + openbox/place.c | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/openbox/config.c b/openbox/config.c index 69904d8..99aa57f 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -137,6 +137,7 @@ void config_app_settings_copy_non_defaults(const ObAppSettings *src, if (src->pos_given) { dst->pos_given = TRUE; + dst->pos_force = src->pos_force; dst->position = src->position; dst->monitor = src->monitor; } @@ -246,6 +247,8 @@ static void parse_per_app_settings(ObParseInst *inst, xmlDocPtr doc, settings->monitor = parse_int(doc, c) + 1; g_free(s); } + + parse_attr_bool("force", n, &settings->pos_force); } if ((n = parse_find_node("focus", app->children))) diff --git a/openbox/config.h b/openbox/config.h index 75275a8..23011a1 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -41,6 +41,7 @@ struct _ObAppSettings GravityPoint position; gboolean pos_given; + gboolean pos_force; guint desktop; gint shade; diff --git a/openbox/place.c b/openbox/place.c index 81fb975..45d7f07 100644 --- a/openbox/place.c +++ b/openbox/place.c @@ -489,8 +489,9 @@ gboolean place_client(ObClient *client, gint *x, gint *y, gboolean userplaced = FALSE; /* per-app settings override program specified position - * but not user specified */ - if ((client->positioned & USPosition) || + * but not user specified, unless pos_force is enabled */ + if (((client->positioned & USPosition) && + !(settings && settings->pos_given && settings->pos_force)) || ((client->positioned & PPosition) && !(settings && settings->pos_given))) return FALSE; -- 1.9.1