some more refactoring
This commit is contained in:
42
view.c
42
view.c
@ -7,6 +7,20 @@
|
||||
|
||||
void (*arrange)(void) = DEFMODE;
|
||||
|
||||
void
|
||||
attach(Client *c) {
|
||||
if(clients)
|
||||
clients->prev = c;
|
||||
c->next = clients;
|
||||
clients = c;
|
||||
}
|
||||
|
||||
void
|
||||
attachstack(Client *c) {
|
||||
c->snext = stack;
|
||||
stack = c;
|
||||
}
|
||||
|
||||
void
|
||||
dofloat(void) {
|
||||
Client *c;
|
||||
@ -30,6 +44,24 @@ dofloat(void) {
|
||||
restack();
|
||||
}
|
||||
|
||||
void
|
||||
detach(Client *c) {
|
||||
if(c->prev)
|
||||
c->prev->next = c->next;
|
||||
if(c->next)
|
||||
c->next->prev = c->prev;
|
||||
if(c == clients)
|
||||
clients = c->next;
|
||||
c->next = c->prev = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
detachstack(Client *c) {
|
||||
Client **tc;
|
||||
for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext);
|
||||
*tc = c->snext;
|
||||
}
|
||||
|
||||
void
|
||||
focusnext(Arg *arg) {
|
||||
Client *c;
|
||||
@ -62,6 +94,16 @@ focusprev(Arg *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
Client *
|
||||
getclient(Window w) {
|
||||
Client *c;
|
||||
|
||||
for(c = clients; c; c = c->next)
|
||||
if(c->win == w)
|
||||
return c;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Bool
|
||||
isvisible(Client *c) {
|
||||
unsigned int i;
|
||||
|
Reference in New Issue
Block a user