From: Mikael Magnusson Date: Wed, 10 Feb 2010 02:35:47 +0000 (+0100) Subject: Place a window in the smallest area it fits in, not the largest we can find X-Git-Tag: mikabox-3.5-7~36^2~1 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=2c9113e734c7942b41dc59be9d40c561cc822a7d;p=mikachu%2Fopenbox.git Place a window in the smallest area it fits in, not the largest we can find --- 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; } }