wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit 922e04ebc380dc7d9876790172ee9ec9bfed344a
parent 17c2fc966afb0b70fd9fbfb5a3b0673568992f9b
Author: Anselm R. Garbe <garbeam@wmii.de>
Date:   Tue, 14 Feb 2006 12:06:16 +0100

implemented kb driven client select


Diffstat:
cmd/wm/client.c | 28++++++++++------------------
cmd/wm/fs.c | 6+++++-
cmd/wm/wm.h | 2+-
liblitz/blitz.h | 4++--
4 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/cmd/wm/client.c b/cmd/wm/client.c @@ -576,38 +576,30 @@ client_to_index(Client *c) void -select_client(Area *a, char *arg) +select_client(Client *c, char *arg) { - Client *c; -/* size_t i;*/ - - if(!a->nclient) - return; - - if(area_to_index(a) > 0) - /*select_column(a->client[a-c, arg)*/; + if(area_to_index(c->area) > 0) + select_column(c, arg); else { - c = a->client[a->sel]; - /* Area *a = c->area; - for(i = 0; (i < a->nclient) && (a->client[i] != c); i++); + int i = client_to_index(c); if(!strncmp(arg, "prev", 5)) { if(!i) i = a->nclient - 1; - focus_client(a->client[i]); + else + i--; } else if(!strncmp(arg, "next", 5)) { if(i + 1 < a->nclient) - focus_client(a->client[i + 1]); + i++; else - focus_client(a->client[0]); + i = 0; } else { const char *errstr; - i = cext_strtonum(arg, 0, a->nclient - 1, &errstr); + i = cext_strtonum(arg, 1, a->nclient, &errstr); if(errstr) return; - focus_client(a->client[i]); } - */ + focus_client(a->client[i - 1]); } } diff --git a/cmd/wm/fs.c b/cmd/wm/fs.c @@ -1074,7 +1074,11 @@ xwrite(IXPConn *c, Fcall *fcall) } break; case Darea: - /* /TODO: /n/{float,n}/ctl commands */ + if(!strncmp(buf, "select ", 7)) { + Area *a = page[i1]->area[i2]; + if(a->nclient) + select_client(a->client[a->sel], &buf[7]); + } break; case Dclient: /* /TODO: /n/{float,n}/n/ctl commands */ diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h @@ -227,7 +227,7 @@ void resize_client(Client *c, XRectangle * r, XPoint * pt); unsigned int bar_height(Client *c); int cid_to_index(Area *a, unsigned short id); int client_to_index(Client *c); -void select_client(Area *a, char *arg); +void select_client(Client *c, char *arg); /* event.c */ void init_x_event_handler(); diff --git a/liblitz/blitz.h b/liblitz/blitz.h @@ -7,8 +7,8 @@ #include <cext.h> #define BLITZ_FONT "fixed" -#define BLITZ_SELCOLORS "#e6ffbf #3e551c #5c6a47" -#define BLITZ_NORMCOLORS "#c9dfa7 #11130d #171c10" +#define BLITZ_SELCOLORS "#ffffff #285577 #4c7899" +#define BLITZ_NORMCOLORS "#222222 #eeeeee #666666" typedef enum { CENTER, WEST, NWEST, NORTH, NEAST, EAST,