X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=client.c;h=434a93b695bca5d0a94dcc77b330f0396741208a;hb=57871415c16664cce494b68dd3e985bcb32942c5;hp=7bc6772d57d7c130908112bafebc3fb693aaf42d;hpb=77f8c075c48e510e064b8f0b7b823a7e1f9f44b7;p=dwm.git diff --git a/client.c b/client.c index 7bc6772..434a93b 100644 --- a/client.c +++ b/client.c @@ -191,7 +191,7 @@ killclient(Arg *arg) { if(!sel) return; - if(sel->proto & WM_PROTOCOL_DELWIN) + if(sel->proto & PROTODELWIN) sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]); else XKillClient(dpy, sel->win); @@ -416,20 +416,18 @@ togglemax(Arg *arg) void unmanage(Client *c) { - Client **l; - XGrabServer(dpy); XSetErrorHandler(xerrordummy); XUngrabButton(dpy, AnyButton, AnyModifier, c->win); XDestroyWindow(dpy, c->title); - 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; + if(c == clients) + clients = c->next; if(sel == c) { sel = getnext(c->next); if(!sel) @@ -450,7 +448,7 @@ unmanage(Client *c) void zoom(Arg *arg) { - Client *c, **l; + Client *c; if(!sel) return; @@ -461,13 +459,10 @@ zoom(Arg *arg) } /* pop */ - for(l = &clients; *l && *l != sel; l = &(*l)->next); if(sel->prev) sel->prev->next = sel->next; if(sel->next) sel->next->prev = sel->prev; - *l = sel->next; - sel->prev = NULL; if(clients) clients->prev = sel;