diff --git a/tabbed.c.bak b/tabbed.c index b3c3c12..6f08ac6 100644 --- a/tabbed.c.bak +++ b/tabbed.c @@ -106,6 +106,7 @@ static void initfont(const char *fontstr); static Bool isprotodel(Client *c); static void keypress(const XEvent *e); static void killclient(const Arg *arg); +static void byebye(const Arg *arg); static void manage(Window win); static void maprequest(const XEvent *e); static void move(const Arg *arg); @@ -547,6 +548,11 @@ keypress(const XEvent *e) { } void +byebye(const Arg *arg) { + exit(0); +} + +void killclient(const Arg *arg) { XEvent ev; @@ -586,10 +592,23 @@ manage(Window w) { XGrabKey(dpy, code, keys[i].mod | modifiers[j], w, True, GrabModeAsync, GrabModeAsync); } + c = emallocz(sizeof *c); - c->next = clients; + c->next = NULL; c->win = w; - clients = c; + + Client *p; + + if(clients) { + for(p = clients; p->next; p = p->next); + p->next = c; + } else { + clients = c; + } + + for(p = clients; p; p = p->next) + fprintf(stderr, "Client: %s\n", p->name); + updatetitle(c); drawbar(); XMapRaised(dpy, w);