applied dfenze cleanups, fixed some comments in dwm.h

This commit is contained in:
Anselm R. Garbe
2007-05-14 11:54:30 +02:00
parent c67dbb28e4
commit ab3d6a7dfe
4 changed files with 20 additions and 21 deletions

View File

@ -152,6 +152,14 @@ focus(Client *c) {
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
}
void
focustopvisible(void) {
Client *c;
for(c = stack; c && !isvisible(c); c = c->snext);
focus(c);
}
void
killclient(const char *arg) {
XEvent ev;
@ -391,10 +399,8 @@ unmanage(Client *c) {
XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
detach(c);
detachstack(c);
if(sel == c) {
for(nc = stack; nc && !isvisible(nc); nc = nc->snext);
focus(nc);
}
if(sel == c)
focustopvisible();
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
setclientstate(c, WithdrawnState);
free(c->tags);