simplified focusclient() 5a13632a
Anselm R. Garbe · 2007-02-22 17:51 1 file(s) · +6 −10
layout.c +6 −10
75 75
   
76 76
	if(!sel || !arg)
77 77
		return;
78 -
	switch(atoi(arg)) {
79 -
	default:
80 -
		return;
81 -
	case 1:
82 -
		for(c = sel->next; c && !isvisible(c); c = c->next);
83 -
		if(!c)
84 -
			for(c = clients; c && !isvisible(c); c = c->next);
85 -
		break;
86 -
	case -1:
78 +
	if(atoi(arg) < 0) {
87 79
		for(c = sel->prev; c && !isvisible(c); c = c->prev);
88 80
		if(!c) {
89 81
			for(c = clients; c && c->next; c = c->next);
90 82
			for(; c && !isvisible(c); c = c->prev);
91 83
		}
92 -
		break;
84 +
	}
85 +
	else {
86 +
		for(c = sel->next; c && !isvisible(c); c = c->next);
87 +
		if(!c)
88 +
			for(c = clients; c && !isvisible(c); c = c->next);
93 89
	}
94 90
	if(c) {
95 91
		focus(c);