]> Dogcows Code - chaz/openbox/commitdiff
sort smallest to largest area
authorDana Jansens <danakj@orodu.net>
Mon, 15 Sep 2003 04:59:23 +0000 (04:59 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 15 Sep 2003 04:59:23 +0000 (04:59 +0000)
openbox/place.c

index af90bb61eba87339d95e2c71cdbd81920bc1648c..27df69f5d337802fa581aa86d59250f658b0ada6 100644 (file)
@@ -124,13 +124,9 @@ static GSList* area_remove(GSList *list, Rect *a)
 
 static gint area_cmp(gconstpointer p1, gconstpointer p2)
 {
-    gint ret;
     const Rect *a1 = p1, *a2 = p2;
 
-    ret = RECT_TOP(*a1) - RECT_TOP(*a2);
-    if (!ret)
-        ret = RECT_LEFT(*a1) - RECT_LEFT(*a2);
-    return ret;
+    return a1->width * a1->height - a2->width * a2->height;
 }
 
 static gboolean place_smart(ObClient *client, gint *x, gint *y,
This page took 0.028795 seconds and 4 git commands to generate.