removed artefacts of single-linked list (thanx to Jukka, I must have been mad) d9a6a3b5
arg@10ksloc.org · 2006-08-01 16:14 2 file(s) · +4 −9
client.c +3 −8
416 416
void
417 417
unmanage(Client *c)
418 418
{
419 -
	Client **l;
420 -
421 419
	XGrabServer(dpy);
422 420
	XSetErrorHandler(xerrordummy);
423 421
424 422
	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
425 423
	XDestroyWindow(dpy, c->title);
426 424
427 -
	for(l = &clients; *l && *l != c; l = &(*l)->next);
428 425
	if(c->prev)
429 426
		c->prev->next = c->next;
430 427
	if(c->next)
431 428
		c->next->prev = c->prev;
432 -
	*l = c->next;
429 +
	if(c == clients)
430 +
		clients = c->next;
433 431
	if(sel == c) {
434 432
		sel = getnext(c->next);
435 433
		if(!sel)
450 448
void
451 449
zoom(Arg *arg)
452 450
{
453 -
	Client *c, **l;
451 +
	Client *c;
454 452
455 453
	if(!sel)
456 454
		return;
461 459
	}
462 460
463 461
	/* pop */
464 -
	for(l = &clients; *l && *l != sel; l = &(*l)->next);
465 462
	if(sel->prev)
466 463
		sel->prev->next = sel->next;
467 464
	if(sel->next)
468 465
		sel->next->prev = sel->prev;
469 -
	*l = sel->next;
470 -
471 466
	sel->prev = NULL;
472 467
	if(clients)
473 468
		clients->prev = sel;
dwm.1 +1 −1
1 -
.TH DWM 1 dwm-0.5
1 +
.TH DWM 1 dwm-0.6
2 2
.SH NAME
3 3
dwm \- dynamic window manager
4 4
.SH SYNOPSIS