|
|
@ -77,7 +77,6 @@ focusnext(Arg *arg)
|
|
|
|
c = getnext(clients, tsel);
|
|
|
|
c = getnext(clients, tsel);
|
|
|
|
if(c) {
|
|
|
|
if(c) {
|
|
|
|
higher(c);
|
|
|
|
higher(c);
|
|
|
|
c->revert = sel;
|
|
|
|
|
|
|
|
focus(c);
|
|
|
|
focus(c);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -93,7 +92,11 @@ focusprev(Arg *arg)
|
|
|
|
if(sel->ismax)
|
|
|
|
if(sel->ismax)
|
|
|
|
togglemax(NULL);
|
|
|
|
togglemax(NULL);
|
|
|
|
|
|
|
|
|
|
|
|
if((c = sel->revert && sel->revert->tags[tsel] ? sel->revert : NULL)) {
|
|
|
|
if(!(c = getprev(sel->prev))) {
|
|
|
|
|
|
|
|
for(c = clients; c && c->next; c = c->next);
|
|
|
|
|
|
|
|
c = getprev(c);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(c) {
|
|
|
|
higher(c);
|
|
|
|
higher(c);
|
|
|
|
focus(c);
|
|
|
|
focus(c);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -127,6 +130,8 @@ gravitate(Client *c, Bool invert)
|
|
|
|
int dx = 0, dy = 0;
|
|
|
|
int dx = 0, dy = 0;
|
|
|
|
|
|
|
|
|
|
|
|
switch(c->grav) {
|
|
|
|
switch(c->grav) {
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
case StaticGravity:
|
|
|
|
case StaticGravity:
|
|
|
|
case NorthWestGravity:
|
|
|
|
case NorthWestGravity:
|
|
|
|
case NorthGravity:
|
|
|
|
case NorthGravity:
|
|
|
@ -143,11 +148,11 @@ gravitate(Client *c, Bool invert)
|
|
|
|
case SouthWestGravity:
|
|
|
|
case SouthWestGravity:
|
|
|
|
dy = -(c->h);
|
|
|
|
dy = -(c->h);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
switch (c->grav) {
|
|
|
|
switch (c->grav) {
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
case StaticGravity:
|
|
|
|
case StaticGravity:
|
|
|
|
case NorthWestGravity:
|
|
|
|
case NorthWestGravity:
|
|
|
|
case WestGravity:
|
|
|
|
case WestGravity:
|
|
|
@ -164,8 +169,6 @@ gravitate(Client *c, Bool invert)
|
|
|
|
case SouthEastGravity:
|
|
|
|
case SouthEastGravity:
|
|
|
|
dx = -(c->w + c->border);
|
|
|
|
dx = -(c->w + c->border);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(invert) {
|
|
|
|
if(invert) {
|
|
|
@ -204,7 +207,6 @@ lower(Client *c)
|
|
|
|
void
|
|
|
|
void
|
|
|
|
manage(Window w, XWindowAttributes *wa)
|
|
|
|
manage(Window w, XWindowAttributes *wa)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int diff;
|
|
|
|
|
|
|
|
Client *c;
|
|
|
|
Client *c;
|
|
|
|
Window trans;
|
|
|
|
Window trans;
|
|
|
|
XSetWindowAttributes twa;
|
|
|
|
XSetWindowAttributes twa;
|
|
|
@ -237,6 +239,8 @@ manage(Window w, XWindowAttributes *wa)
|
|
|
|
|
|
|
|
|
|
|
|
settags(c);
|
|
|
|
settags(c);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(clients)
|
|
|
|
|
|
|
|
clients->prev = c;
|
|
|
|
c->next = clients;
|
|
|
|
c->next = clients;
|
|
|
|
clients = c;
|
|
|
|
clients = c;
|
|
|
|
|
|
|
|
|
|
|
@ -264,6 +268,7 @@ manage(Window w, XWindowAttributes *wa)
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
XMapRaised(dpy, c->win);
|
|
|
|
XMapRaised(dpy, c->win);
|
|
|
|
XMapRaised(dpy, c->title);
|
|
|
|
XMapRaised(dpy, c->title);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -273,9 +278,15 @@ pop(Client *c)
|
|
|
|
Client **l;
|
|
|
|
Client **l;
|
|
|
|
|
|
|
|
|
|
|
|
for(l = &clients; *l && *l != c; l = &(*l)->next);
|
|
|
|
for(l = &clients; *l && *l != c; l = &(*l)->next);
|
|
|
|
|
|
|
|
if(c->prev)
|
|
|
|
|
|
|
|
c->prev->next = c->next;
|
|
|
|
|
|
|
|
if(c->next)
|
|
|
|
|
|
|
|
c->next->prev = c->prev;
|
|
|
|
*l = c->next;
|
|
|
|
*l = c->next;
|
|
|
|
|
|
|
|
|
|
|
|
c->next = clients; /* pop */
|
|
|
|
if(clients)
|
|
|
|
|
|
|
|
clients->prev = c;
|
|
|
|
|
|
|
|
c->next = clients;
|
|
|
|
clients = c;
|
|
|
|
clients = c;
|
|
|
|
arrange(NULL);
|
|
|
|
arrange(NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -439,13 +450,18 @@ unmanage(Client *c)
|
|
|
|
XDestroyWindow(dpy, c->title);
|
|
|
|
XDestroyWindow(dpy, c->title);
|
|
|
|
|
|
|
|
|
|
|
|
for(l = &clients; *l && *l != c; l = &(*l)->next);
|
|
|
|
for(l = &clients; *l && *l != c; l = &(*l)->next);
|
|
|
|
|
|
|
|
if(c->prev)
|
|
|
|
|
|
|
|
c->prev->next = c->next;
|
|
|
|
|
|
|
|
if(c->next)
|
|
|
|
|
|
|
|
c->next->prev = c->prev;
|
|
|
|
*l = c->next;
|
|
|
|
*l = c->next;
|
|
|
|
for(l = &clients; *l; l = &(*l)->next)
|
|
|
|
if(sel == c) {
|
|
|
|
if((*l)->revert == c)
|
|
|
|
sel = getnext(c->next, tsel);
|
|
|
|
(*l)->revert = NULL;
|
|
|
|
if(!sel)
|
|
|
|
if(sel == c)
|
|
|
|
sel = getprev(c->prev);
|
|
|
|
sel = sel->revert ? sel->revert : clients;
|
|
|
|
if(!sel)
|
|
|
|
|
|
|
|
sel = clients;
|
|
|
|
|
|
|
|
}
|
|
|
|
free(c);
|
|
|
|
free(c);
|
|
|
|
|
|
|
|
|
|
|
|
XSync(dpy, False);
|
|
|
|
XSync(dpy, False);
|
|
|
|