client: Remove client_switch function: put all in uicb_client_{prev, next}

This commit is contained in:
Martin Duquesnoy
2008-10-21 21:00:52 +02:00
parent e30c88f53c
commit 23de91e5b4
3 changed files with 25 additions and 37 deletions

View File

@@ -66,59 +66,49 @@ client_detach(Client *c)
return;
}
/* True : next
* False : prev */
void
client_switch(Bool b)
uicb_client_prev(uicb_t cmd)
{
Client *c;
if(!sel || ishide(sel))
return;
if(b)
for(c = sel->prev; c && ishide(c); c = c->prev);
if(!c)
{
for(c = sel->next; c && ishide(c); c = c->next);
if(!c)
for(c = clients; c && ishide(c); c = c->next);
if(c)
{
client_focus(c);
if(!c->tile)
client_raise(c);
}
for(c = clients; c && c->next; c = c->next);
for(; c && ishide(c); c = c->prev);
}
else
if(c)
{
for(c = sel->prev; c && ishide(c); c = c->prev);
if(!c)
{
for(c = clients; c && c->next; c = c->next);
for(; c && ishide(c); c = c->prev);
}
if(c)
{
client_focus(c);
if(!c->tile)
client_raise(c);
}
client_focus(c);
if(!c->tile)
client_raise(c);
}
arrange();
return;
}
void
uicb_client_prev(uicb_t cmd)
{
client_switch(False);
return;
}
void
uicb_client_next(uicb_t cmd)
{
client_switch(True);
Client *c;
if(!sel || ishide(sel))
return;
for(c = sel->next; c && ishide(c); c = c->next);
if(!c)
for(c = clients; c && ishide(c); c = c->next);
if(c)
{
client_focus(c);
if(!c->tile)
client_raise(c);
}
arrange();
return;
}

View File

@@ -32,7 +32,6 @@
#include "wmfs.h"
/* if cmd is +X or -X, this is just switch
* else {1, 2.. 9} it's go to the wanted tag. */
void

View File

@@ -84,7 +84,6 @@ ushort textw(const char *text);
int client_pertag(int tag);
void client_attach(Client *c);
void client_detach(Client *c);
void client_switch(Bool c);
void client_focus(Client *c);
Client *client_get(Window w);
Client *client_gettbar(Window w);