summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client.c11
-rw-r--r--dwm.12
2 files changed, 4 insertions, 9 deletions
diff --git a/client.c b/client.c
index 7bc6772..fd91af5 100644
--- a/client.c
+++ b/client.c
@@ -416,20 +416,18 @@ togglemax(Arg *arg)
416void 416void
417unmanage(Client *c) 417unmanage(Client *c)
418{ 418{
419 Client **l;
420
421 XGrabServer(dpy); 419 XGrabServer(dpy);
422 XSetErrorHandler(xerrordummy); 420 XSetErrorHandler(xerrordummy);
423 421
424 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 422 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
425 XDestroyWindow(dpy, c->title); 423 XDestroyWindow(dpy, c->title);
426 424
427 for(l = &clients; *l && *l != c; l = &(*l)->next);
428 if(c->prev) 425 if(c->prev)
429 c->prev->next = c->next; 426 c->prev->next = c->next;
430 if(c->next) 427 if(c->next)
431 c->next->prev = c->prev; 428 c->next->prev = c->prev;
432 *l = c->next; 429 if(c == clients)
430 clients = c->next;
433 if(sel == c) { 431 if(sel == c) {
434 sel = getnext(c->next); 432 sel = getnext(c->next);
435 if(!sel) 433 if(!sel)
@@ -450,7 +448,7 @@ unmanage(Client *c)
450void 448void
451zoom(Arg *arg) 449zoom(Arg *arg)
452{ 450{
453 Client *c, **l; 451 Client *c;
454 452
455 if(!sel) 453 if(!sel)
456 return; 454 return;
@@ -461,13 +459,10 @@ zoom(Arg *arg)
461 } 459 }
462 460
463 /* pop */ 461 /* pop */
464 for(l = &clients; *l && *l != sel; l = &(*l)->next);
465 if(sel->prev) 462 if(sel->prev)
466 sel->prev->next = sel->next; 463 sel->prev->next = sel->next;
467 if(sel->next) 464 if(sel->next)
468 sel->next->prev = sel->prev; 465 sel->next->prev = sel->prev;
469 *l = sel->next;
470
471 sel->prev = NULL; 466 sel->prev = NULL;
472 if(clients) 467 if(clients)
473 clients->prev = sel; 468 clients->prev = sel;
diff --git a/dwm.1 b/dwm.1
index e7f1758..14e3209 100644
--- a/dwm.1
+++ b/dwm.1
@@ -1,4 +1,4 @@
1.TH DWM 1 dwm-0.5 1.TH DWM 1 dwm-0.6
2.SH NAME 2.SH NAME
3dwm \- dynamic window manager 3dwm \- dynamic window manager
4.SH SYNOPSIS 4.SH SYNOPSIS