removed the exact focus mechanism of next/prev window 14d8d828
Anselm R Garbe · 2008-05-17 14:41 4 file(s) · +16 −26
Makefile +1 −1
36 36
	@echo creating dist tarball
37 37
	@mkdir -p dwm-${VERSION}
38 38
	@cp -R LICENSE Makefile README config.def.h config.mk \
39 -
		dwm.1 ${SRC} dwm-${VERSION}
39 +
		dwm.1 *.c dwm-${VERSION}
40 40
	@tar -cf dwm-${VERSION}.tar dwm-${VERSION}
41 41
	@gzip dwm-${VERSION}.tar
42 42
	@rm -rf dwm-${VERSION}
config.def.h +0 −2
37 37
	{ MODKEY,                       XK_p,      spawn,          "exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'" },
38 38
	{ MODKEY|ShiftMask,             XK_Return, spawn,          "exec uxterm" },
39 39
	{ MODKEY,                       XK_j,      focusnext,      NULL },
40 -
	{ MODKEY|ShiftMask,             XK_j,      focusnext,      "exact" },
41 40
	{ MODKEY,                       XK_k,      focusprev,      NULL },
42 -
	{ MODKEY|ShiftMask,             XK_k,      focusprev,      "exact" },
43 41
	{ MODKEY,                       XK_h,      setmfact,       "-0.05" },
44 42
	{ MODKEY,                       XK_l,      setmfact,       "+0.05" },
45 43
	{ MODKEY,                       XK_Return, zoom,           NULL },
dwm.1 +0 −6
63 63
.B Mod1\-j
64 64
Focus next window.
65 65
.TP
66 -
.B Mod1\-Shift\-j
67 -
Focus next window with exactly the same tags as the current one.
68 -
.TP
69 66
.B Mod1\-k
70 67
Focus previous window.
71 -
.TP
72 -
.B Mod1\-Shift\-k
73 -
Focus previous window with exactly the same tags as the current one.
74 68
.TP
75 69
.B Mod1\-h
76 70
Decrease master area size.
dwm.c +15 −17
145 145
Bool isoccupied(unsigned int t);
146 146
Bool isprotodel(Client *c);
147 147
Bool isurgent(unsigned int t);
148 -
Bool isvisible(Client *c, Bool *cmp);
148 +
Bool isvisible(Client *c);
149 149
void keypress(XEvent *e);
150 150
void killclient(const char *arg);
151 151
void manage(Window w, XWindowAttributes *wa);
261 261
	Client *c;
262 262
263 263
	for(c = clients; c; c = c->next)
264 -
		if(isvisible(c, NULL)) {
264 +
		if(isvisible(c)) {
265 265
			unban(c);
266 266
			if(!lt->arrange || c->isfloating)
267 267
				resize(c, c->x, c->y, c->w, c->h, True);
441 441
			if((ev->value_mask & (CWX|CWY))
442 442
			&& !(ev->value_mask & (CWWidth|CWHeight)))
443 443
				configure(c);
444 -
			if(isvisible(c, NULL))
444 +
			if(isvisible(c))
445 445
				XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
446 446
		}
447 447
		else
494 494
	Client *c;
495 495
496 496
	dc.x = 0;
497 -
	for(c = stack; c && !isvisible(c, NULL); c = c->snext);
497 +
	for(c = stack; c && !isvisible(c); c = c->snext);
498 498
	for(i = 0; i < LENGTH(tags); i++) {
499 499
		dc.w = textw(tags[i]);
500 500
		if(tagset[seltags][i]) {
634 634
635 635
void
636 636
focus(Client *c) {
637 -
	if(!c || (c && !isvisible(c, NULL)))
638 -
		for(c = stack; c && !isvisible(c, NULL); c = c->snext);
637 +
	if(!c || (c && !isvisible(c)))
638 +
		for(c = stack; c && !isvisible(c); c = c->snext);
639 639
	if(sel && sel != c) {
640 640
		grabbuttons(sel, False);
641 641
		XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
669 669
670 670
	if(!sel)
671 671
		return;
672 -
	for(c = sel->next; c && !isvisible(c, arg ? sel->tags : NULL); c = c->next);
672 +
	for(c = sel->next; c && !isvisible(c); c = c->next);
673 673
	if(!c)
674 -
		for(c = clients; c && !isvisible(c, arg ? sel->tags : NULL); c = c->next);
674 +
		for(c = clients; c && !isvisible(c); c = c->next);
675 675
	if(c) {
676 676
		focus(c);
677 677
		restack();
684 684
685 685
	if(!sel)
686 686
		return;
687 -
	for(c = sel->prev; c && !isvisible(c, arg ? sel->tags : NULL); c = c->prev);
687 +
	for(c = sel->prev; c && !isvisible(c); c = c->prev);
688 688
	if(!c) {
689 689
		for(c = clients; c && c->next; c = c->next);
690 -
		for(; c && !isvisible(c, arg ? sel->tags : NULL); c = c->prev);
690 +
		for(; c && !isvisible(c); c = c->prev);
691 691
	}
692 692
	if(c) {
693 693
		focus(c);
888 888
}
889 889
890 890
Bool
891 -
isvisible(Client *c, Bool *cmp) {
891 +
isvisible(Client *c) {
892 892
	unsigned int i;
893 893
894 -
	if(!cmp)
895 -
		cmp = tagset[seltags];
896 894
	for(i = 0; i < LENGTH(tags); i++)
897 -
		if(c->tags[i] && cmp[i])
895 +
		if(c->tags[i] && tagset[seltags][i])
898 896
			return True;
899 897
	return False;
900 898
}
1019 1017
	Client *c;
1020 1018
1021 1019
	for(c = clients; c; c = c->next)
1022 -
		if(!c->isfloating && isvisible(c, NULL))
1020 +
		if(!c->isfloating && isvisible(c))
1023 1021
			resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, RESIZEHINTS);
1024 1022
}
1025 1023
1070 1068
1071 1069
Client *
1072 1070
nextunfloating(Client *c) {
1073 -
	for(; c && (c->isfloating || !isvisible(c, NULL)); c = c->next);
1071 +
	for(; c && (c->isfloating || !isvisible(c)); c = c->next);
1074 1072
	return c;
1075 1073
}
1076 1074
1230 1228
		wc.stack_mode = Below;
1231 1229
		wc.sibling = barwin;
1232 1230
		for(c = stack; c; c = c->snext)
1233 -
			if(!c->isfloating && isvisible(c, NULL)) {
1231 +
			if(!c->isfloating && isvisible(c)) {
1234 1232
				XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
1235 1233
				wc.sibling = c->win;
1236 1234
			}