From 2c9113e734c7942b41dc59be9d40c561cc822a7d Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Wed, 10 Feb 2010 03:35:47 +0100 Subject: [PATCH] Place a window in the smallest area it fits in, not the largest we can find --- openbox/place.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openbox/place.c b/openbox/place.c index d9919d0c..24a0c1b5 100644 --- a/openbox/place.c +++ b/openbox/place.c @@ -233,13 +233,13 @@ static gboolean place_nooverlap(ObClient *c, gint *x, gint *y) Rect **areas; gint ignore; gboolean ret; - gint maxsize; + gint minsize; GSList *spaces = NULL, *sit, *maxit; guint i; areas = pick_head(c); ret = FALSE; - maxsize = 0; + minsize = 0; maxit = NULL; /* try ignoring different things to find empty space */ @@ -310,9 +310,9 @@ static gboolean place_nooverlap(ObClient *c, gint *x, gint *y) if (r->width >= c->frame->area.width && r->height >= c->frame->area.height && - r->width * r->height > maxsize) + (!minsize || r->width * r->height < minsize)) { - maxsize = r->width * r->height; + minsize = r->width * r->height; maxit = sit; } } -- 2.34.1