|
|
|
@ -200,6 +200,7 @@ static void pop(Client *);
|
|
|
|
|
static void propertynotify(XEvent *e); |
|
|
|
|
static void quit(const Arg *arg); |
|
|
|
|
static Monitor *recttomon(int x, int y, int w, int h); |
|
|
|
|
static void reorganizetags(const Arg *arg); |
|
|
|
|
static void resize(Client *c, int x, int y, int w, int h, int interact); |
|
|
|
|
static void resizeclient(Client *c, int x, int y, int w, int h); |
|
|
|
|
static void resizemouse(const Arg *arg); |
|
|
|
@ -1348,6 +1349,33 @@ recttomon(int x, int y, int w, int h)
|
|
|
|
|
return r; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
reorganizetags(const Arg *arg) { |
|
|
|
|
Client *c; |
|
|
|
|
unsigned int occ, unocc, i; |
|
|
|
|
unsigned int tagdest[LENGTH(tags)]; |
|
|
|
|
|
|
|
|
|
occ = 0; |
|
|
|
|
for (c = selmon->clients; c; c = c->next) |
|
|
|
|
occ |= (1 << (ffs(c->tags)-1)); |
|
|
|
|
unocc = 0; |
|
|
|
|
for (i = 0; i < LENGTH(tags); ++i) { |
|
|
|
|
while (unocc < i && (occ & (1 << unocc))) |
|
|
|
|
unocc++; |
|
|
|
|
if (occ & (1 << i)) { |
|
|
|
|
tagdest[i] = unocc; |
|
|
|
|
occ &= ~(1 << i); |
|
|
|
|
occ |= 1 << unocc; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (c = selmon->clients; c; c = c->next) |
|
|
|
|
c->tags = 1 << tagdest[ffs(c->tags)-1]; |
|
|
|
|
if (selmon->sel) |
|
|
|
|
selmon->tagset[selmon->seltags] = selmon->sel->tags; |
|
|
|
|
arrange(selmon); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
resize(Client *c, int x, int y, int w, int h, int interact) |
|
|
|
|
{ |
|
|
|
|