removed the exact focus mechanism of next/prev window
This commit is contained in:
		
							parent
							
								
									4246affc15
								
							
						
					
					
						commit
						14d8d828ab
					
				
							
								
								
									
										2
									
								
								Makefile
								
								
								
								
							
							
						
						
									
										2
									
								
								Makefile
								
								
								
								
							| 
						 | 
					@ -36,7 +36,7 @@ dist: clean
 | 
				
			||||||
	@echo creating dist tarball
 | 
						@echo creating dist tarball
 | 
				
			||||||
	@mkdir -p dwm-${VERSION}
 | 
						@mkdir -p dwm-${VERSION}
 | 
				
			||||||
	@cp -R LICENSE Makefile README config.def.h config.mk \
 | 
						@cp -R LICENSE Makefile README config.def.h config.mk \
 | 
				
			||||||
		dwm.1 ${SRC} dwm-${VERSION}
 | 
							dwm.1 *.c dwm-${VERSION}
 | 
				
			||||||
	@tar -cf dwm-${VERSION}.tar dwm-${VERSION}
 | 
						@tar -cf dwm-${VERSION}.tar dwm-${VERSION}
 | 
				
			||||||
	@gzip dwm-${VERSION}.tar
 | 
						@gzip dwm-${VERSION}.tar
 | 
				
			||||||
	@rm -rf dwm-${VERSION}
 | 
						@rm -rf dwm-${VERSION}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,9 +37,7 @@ Key keys[] = {
 | 
				
			||||||
	{ MODKEY,                       XK_p,      spawn,          "exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'" },
 | 
						{ MODKEY,                       XK_p,      spawn,          "exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'" },
 | 
				
			||||||
	{ MODKEY|ShiftMask,             XK_Return, spawn,          "exec uxterm" },
 | 
						{ MODKEY|ShiftMask,             XK_Return, spawn,          "exec uxterm" },
 | 
				
			||||||
	{ MODKEY,                       XK_j,      focusnext,      NULL },
 | 
						{ MODKEY,                       XK_j,      focusnext,      NULL },
 | 
				
			||||||
	{ MODKEY|ShiftMask,             XK_j,      focusnext,      "exact" },
 | 
					 | 
				
			||||||
	{ MODKEY,                       XK_k,      focusprev,      NULL },
 | 
						{ MODKEY,                       XK_k,      focusprev,      NULL },
 | 
				
			||||||
	{ MODKEY|ShiftMask,             XK_k,      focusprev,      "exact" },
 | 
					 | 
				
			||||||
	{ MODKEY,                       XK_h,      setmfact,       "-0.05" },
 | 
						{ MODKEY,                       XK_h,      setmfact,       "-0.05" },
 | 
				
			||||||
	{ MODKEY,                       XK_l,      setmfact,       "+0.05" },
 | 
						{ MODKEY,                       XK_l,      setmfact,       "+0.05" },
 | 
				
			||||||
	{ MODKEY,                       XK_Return, zoom,           NULL },
 | 
						{ MODKEY,                       XK_Return, zoom,           NULL },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										6
									
								
								dwm.1
								
								
								
								
							
							
						
						
									
										6
									
								
								dwm.1
								
								
								
								
							| 
						 | 
					@ -63,15 +63,9 @@ Toggles between layouts.
 | 
				
			||||||
.B Mod1\-j
 | 
					.B Mod1\-j
 | 
				
			||||||
Focus next window.
 | 
					Focus next window.
 | 
				
			||||||
.TP
 | 
					.TP
 | 
				
			||||||
.B Mod1\-Shift\-j
 | 
					 | 
				
			||||||
Focus next window with exactly the same tags as the current one.
 | 
					 | 
				
			||||||
.TP
 | 
					 | 
				
			||||||
.B Mod1\-k
 | 
					.B Mod1\-k
 | 
				
			||||||
Focus previous window.
 | 
					Focus previous window.
 | 
				
			||||||
.TP
 | 
					.TP
 | 
				
			||||||
.B Mod1\-Shift\-k
 | 
					 | 
				
			||||||
Focus previous window with exactly the same tags as the current one.
 | 
					 | 
				
			||||||
.TP
 | 
					 | 
				
			||||||
.B Mod1\-h
 | 
					.B Mod1\-h
 | 
				
			||||||
Decrease master area size.
 | 
					Decrease master area size.
 | 
				
			||||||
.TP
 | 
					.TP
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										32
									
								
								dwm.c
								
								
								
								
							
							
						
						
									
										32
									
								
								dwm.c
								
								
								
								
							| 
						 | 
					@ -145,7 +145,7 @@ void initfont(const char *fontstr);
 | 
				
			||||||
Bool isoccupied(unsigned int t);
 | 
					Bool isoccupied(unsigned int t);
 | 
				
			||||||
Bool isprotodel(Client *c);
 | 
					Bool isprotodel(Client *c);
 | 
				
			||||||
Bool isurgent(unsigned int t);
 | 
					Bool isurgent(unsigned int t);
 | 
				
			||||||
Bool isvisible(Client *c, Bool *cmp);
 | 
					Bool isvisible(Client *c);
 | 
				
			||||||
void keypress(XEvent *e);
 | 
					void keypress(XEvent *e);
 | 
				
			||||||
void killclient(const char *arg);
 | 
					void killclient(const char *arg);
 | 
				
			||||||
void manage(Window w, XWindowAttributes *wa);
 | 
					void manage(Window w, XWindowAttributes *wa);
 | 
				
			||||||
| 
						 | 
					@ -261,7 +261,7 @@ arrange(void) {
 | 
				
			||||||
	Client *c;
 | 
						Client *c;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for(c = clients; c; c = c->next)
 | 
						for(c = clients; c; c = c->next)
 | 
				
			||||||
		if(isvisible(c, NULL)) {
 | 
							if(isvisible(c)) {
 | 
				
			||||||
			unban(c);
 | 
								unban(c);
 | 
				
			||||||
			if(!lt->arrange || c->isfloating)
 | 
								if(!lt->arrange || c->isfloating)
 | 
				
			||||||
				resize(c, c->x, c->y, c->w, c->h, True);
 | 
									resize(c, c->x, c->y, c->w, c->h, True);
 | 
				
			||||||
| 
						 | 
					@ -441,7 +441,7 @@ configurerequest(XEvent *e) {
 | 
				
			||||||
			if((ev->value_mask & (CWX|CWY))
 | 
								if((ev->value_mask & (CWX|CWY))
 | 
				
			||||||
			&& !(ev->value_mask & (CWWidth|CWHeight)))
 | 
								&& !(ev->value_mask & (CWWidth|CWHeight)))
 | 
				
			||||||
				configure(c);
 | 
									configure(c);
 | 
				
			||||||
			if(isvisible(c, NULL))
 | 
								if(isvisible(c))
 | 
				
			||||||
				XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
 | 
									XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
| 
						 | 
					@ -494,7 +494,7 @@ drawbar(void) {
 | 
				
			||||||
	Client *c;
 | 
						Client *c;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	dc.x = 0;
 | 
						dc.x = 0;
 | 
				
			||||||
	for(c = stack; c && !isvisible(c, NULL); c = c->snext);
 | 
						for(c = stack; c && !isvisible(c); c = c->snext);
 | 
				
			||||||
	for(i = 0; i < LENGTH(tags); i++) {
 | 
						for(i = 0; i < LENGTH(tags); i++) {
 | 
				
			||||||
		dc.w = textw(tags[i]);
 | 
							dc.w = textw(tags[i]);
 | 
				
			||||||
		if(tagset[seltags][i]) {
 | 
							if(tagset[seltags][i]) {
 | 
				
			||||||
| 
						 | 
					@ -634,8 +634,8 @@ expose(XEvent *e) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
focus(Client *c) {
 | 
					focus(Client *c) {
 | 
				
			||||||
	if(!c || (c && !isvisible(c, NULL)))
 | 
						if(!c || (c && !isvisible(c)))
 | 
				
			||||||
		for(c = stack; c && !isvisible(c, NULL); c = c->snext);
 | 
							for(c = stack; c && !isvisible(c); c = c->snext);
 | 
				
			||||||
	if(sel && sel != c) {
 | 
						if(sel && sel != c) {
 | 
				
			||||||
		grabbuttons(sel, False);
 | 
							grabbuttons(sel, False);
 | 
				
			||||||
		XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
 | 
							XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
 | 
				
			||||||
| 
						 | 
					@ -669,9 +669,9 @@ focusnext(const char *arg) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(!sel)
 | 
						if(!sel)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	for(c = sel->next; c && !isvisible(c, arg ? sel->tags : NULL); c = c->next);
 | 
						for(c = sel->next; c && !isvisible(c); c = c->next);
 | 
				
			||||||
	if(!c)
 | 
						if(!c)
 | 
				
			||||||
		for(c = clients; c && !isvisible(c, arg ? sel->tags : NULL); c = c->next);
 | 
							for(c = clients; c && !isvisible(c); c = c->next);
 | 
				
			||||||
	if(c) {
 | 
						if(c) {
 | 
				
			||||||
		focus(c);
 | 
							focus(c);
 | 
				
			||||||
		restack();
 | 
							restack();
 | 
				
			||||||
| 
						 | 
					@ -684,10 +684,10 @@ focusprev(const char *arg) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(!sel)
 | 
						if(!sel)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	for(c = sel->prev; c && !isvisible(c, arg ? sel->tags : NULL); c = c->prev);
 | 
						for(c = sel->prev; c && !isvisible(c); c = c->prev);
 | 
				
			||||||
	if(!c) {
 | 
						if(!c) {
 | 
				
			||||||
		for(c = clients; c && c->next; c = c->next);
 | 
							for(c = clients; c && c->next; c = c->next);
 | 
				
			||||||
		for(; c && !isvisible(c, arg ? sel->tags : NULL); c = c->prev);
 | 
							for(; c && !isvisible(c); c = c->prev);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if(c) {
 | 
						if(c) {
 | 
				
			||||||
		focus(c);
 | 
							focus(c);
 | 
				
			||||||
| 
						 | 
					@ -888,13 +888,11 @@ isurgent(unsigned int t) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Bool
 | 
					Bool
 | 
				
			||||||
isvisible(Client *c, Bool *cmp) {
 | 
					isvisible(Client *c) {
 | 
				
			||||||
	unsigned int i;
 | 
						unsigned int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(!cmp)
 | 
					 | 
				
			||||||
		cmp = tagset[seltags];
 | 
					 | 
				
			||||||
	for(i = 0; i < LENGTH(tags); i++)
 | 
						for(i = 0; i < LENGTH(tags); i++)
 | 
				
			||||||
		if(c->tags[i] && cmp[i])
 | 
							if(c->tags[i] && tagset[seltags][i])
 | 
				
			||||||
			return True;
 | 
								return True;
 | 
				
			||||||
	return False;
 | 
						return False;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1019,7 +1017,7 @@ monocle(void) {
 | 
				
			||||||
	Client *c;
 | 
						Client *c;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for(c = clients; c; c = c->next)
 | 
						for(c = clients; c; c = c->next)
 | 
				
			||||||
		if(!c->isfloating && isvisible(c, NULL))
 | 
							if(!c->isfloating && isvisible(c))
 | 
				
			||||||
			resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, RESIZEHINTS);
 | 
								resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, RESIZEHINTS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1070,7 +1068,7 @@ movemouse(Client *c) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Client *
 | 
					Client *
 | 
				
			||||||
nextunfloating(Client *c) {
 | 
					nextunfloating(Client *c) {
 | 
				
			||||||
	for(; c && (c->isfloating || !isvisible(c, NULL)); c = c->next);
 | 
						for(; c && (c->isfloating || !isvisible(c)); c = c->next);
 | 
				
			||||||
	return c;
 | 
						return c;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1230,7 +1228,7 @@ restack(void) {
 | 
				
			||||||
		wc.stack_mode = Below;
 | 
							wc.stack_mode = Below;
 | 
				
			||||||
		wc.sibling = barwin;
 | 
							wc.sibling = barwin;
 | 
				
			||||||
		for(c = stack; c; c = c->snext)
 | 
							for(c = stack; c; c = c->snext)
 | 
				
			||||||
			if(!c->isfloating && isvisible(c, NULL)) {
 | 
								if(!c->isfloating && isvisible(c)) {
 | 
				
			||||||
				XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
 | 
									XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
 | 
				
			||||||
				wc.sibling = c->win;
 | 
									wc.sibling = c->win;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue