forked from e16/e16
1
0
Fork 0

arrange: Disable ARRANGE_BY_POSITION mode

Rather perculiar thing..
This commit is contained in:
Kim Woelders 2022-04-04 17:49:26 +02:00
parent 684e911c9e
commit edd9216610
1 changed files with 7 additions and 1 deletions

View File

@ -32,7 +32,7 @@
#define ARRANGE_BY_ORDER 0
#define ARRANGE_BY_SIZE 1
#define ARRANGE_BY_POSITION 2
/* fine ARRANGE_BY_POSITION 2 */
typedef struct {
void *data;
@ -290,6 +290,7 @@ _rects_sort_size(const void *_a, const void *_b)
return (b->w * b->h) - (a->h * a->w);
}
#ifdef ARRANGE_BY_POSITION
static int
_rects_sort_pos(const void *_a, const void *_b)
{
@ -298,6 +299,7 @@ _rects_sort_pos(const void *_a, const void *_b)
return (b->x + b->w / 2 + b->y + b->h / 2) - (a->x - a->y);
}
#endif
static void
ArrangeRects(const RectBox * fixed, int fixed_count, RectBox * floating,
@ -348,9 +350,11 @@ ArrangeRects(const RectBox * fixed, int fixed_count, RectBox * floating,
case ARRANGE_BY_SIZE:
qsort(floating, floating_count, sizeof(RectBox), _rects_sort_size);
break;
#ifdef ARRANGE_BY_POSITION
case ARRANGE_BY_POSITION:
qsort(floating, floating_count, sizeof(RectBox), _rects_sort_pos);
break;
#endif
}
/* for every floating rect in order, "fit" it into the sorted list */
@ -921,8 +925,10 @@ ArrangeEwins(const char *params)
{
if (!strcmp("order", type))
method = ARRANGE_BY_ORDER;
#ifdef ARRANGE_BY_POSITION
else if (!strcmp("place", type))
method = ARRANGE_BY_POSITION;
#endif
}
fixed = floating = ret = NULL;