summaryrefslogtreecommitdiff
path: root/openbox/place.c
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@comhem.se>2007-06-13 17:08:32 +0000
committerMikael Magnusson <mikachu@comhem.se>2007-06-13 17:08:32 +0000
commite048751f914d16cb6346f7e7ca6532eaae44ce31 (patch)
tree74320ba31e91bc526705bb6d7862a829f352c276 /openbox/place.c
parent774b32f14ed63ee5da4613ba6c1399c54972614d (diff)
add center option to placement section
Diffstat (limited to 'openbox/place.c')
-rw-r--r--openbox/place.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/openbox/place.c b/openbox/place.c
index adbb1f4b..845becdb 100644
--- a/openbox/place.c
+++ b/openbox/place.c
@@ -326,8 +326,12 @@ static gboolean place_nooverlap(ObClient *c, gint *x, gint *y)
Rect *r = maxit->data;
/* center it in the area */
- *x = r->x + (r->width - c->frame->area.width) / 2;
- *y = r->y + (r->height - c->frame->area.height) / 2;
+ *x = r->x;
+ *y = r->y;
+ if (config_place_center) {
+ *x += (r->width - c->frame->area.width) / 2;
+ *y += (r->height - c->frame->area.height) / 2;
+ }
ret = TRUE;
}