summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-05-17 14:41:41 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-05-17 14:41:41 +0100
commit14d8d828abbb91db3305dfa666c8c70358d1d3c7 (patch)
tree0f4b1c2a394ba1ddf0ddd8d1e540b80bab586c49
parentmoved all tile()-related stuff into tile.c which is included from config.def.... (diff)
downloaddwm-14d8d828abbb91db3305dfa666c8c70358d1d3c7.tar.gz
dwm-14d8d828abbb91db3305dfa666c8c70358d1d3c7.zip
removed the exact focus mechanism of next/prev window
-rw-r--r--Makefile2
-rw-r--r--config.def.h2
-rw-r--r--dwm.16
-rw-r--r--dwm.c32
4 files changed, 16 insertions, 26 deletions
diff --git a/Makefile b/Makefile
index b139b54..2615673 100644
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,7 @@ dist: clean
36 @echo creating dist tarball 36 @echo creating dist tarball
37 @mkdir -p dwm-${VERSION} 37 @mkdir -p dwm-${VERSION}
38 @cp -R LICENSE Makefile README config.def.h config.mk \ 38 @cp -R LICENSE Makefile README config.def.h config.mk \
39 dwm.1 ${SRC} dwm-${VERSION} 39 dwm.1 *.c dwm-${VERSION}
40 @tar -cf dwm-${VERSION}.tar dwm-${VERSION} 40 @tar -cf dwm-${VERSION}.tar dwm-${VERSION}
41 @gzip dwm-${VERSION}.tar 41 @gzip dwm-${VERSION}.tar
42 @rm -rf dwm-${VERSION} 42 @rm -rf dwm-${VERSION}
diff --git a/config.def.h b/config.def.h
index f35769c..9ce750e 100644
--- a/config.def.h
+++ b/config.def.h
@@ -37,9 +37,7 @@ Key keys[] = {
37 { MODKEY, XK_p, spawn, "exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'" }, 37 { MODKEY, XK_p, spawn, "exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'" },
38 { MODKEY|ShiftMask, XK_Return, spawn, "exec uxterm" }, 38 { MODKEY|ShiftMask, XK_Return, spawn, "exec uxterm" },
39 { MODKEY, XK_j, focusnext, NULL }, 39 { MODKEY, XK_j, focusnext, NULL },
40 { MODKEY|ShiftMask, XK_j, focusnext, "exact" },
41 { MODKEY, XK_k, focusprev, NULL }, 40 { MODKEY, XK_k, focusprev, NULL },
42 { MODKEY|ShiftMask, XK_k, focusprev, "exact" },
43 { MODKEY, XK_h, setmfact, "-0.05" }, 41 { MODKEY, XK_h, setmfact, "-0.05" },
44 { MODKEY, XK_l, setmfact, "+0.05" }, 42 { MODKEY, XK_l, setmfact, "+0.05" },
45 { MODKEY, XK_Return, zoom, NULL }, 43 { MODKEY, XK_Return, zoom, NULL },
diff --git a/dwm.1 b/dwm.1
index 8b53942..7bacbc6 100644
--- a/dwm.1
+++ b/dwm.1
@@ -63,15 +63,9 @@ Toggles between layouts.
63.B Mod1\-j 63.B Mod1\-j
64Focus next window. 64Focus next window.
65.TP 65.TP
66.B Mod1\-Shift\-j
67Focus next window with exactly the same tags as the current one.
68.TP
69.B Mod1\-k 66.B Mod1\-k
70Focus previous window. 67Focus previous window.
71.TP 68.TP
72.B Mod1\-Shift\-k
73Focus previous window with exactly the same tags as the current one.
74.TP
75.B Mod1\-h 69.B Mod1\-h
76Decrease master area size. 70Decrease master area size.
77.TP 71.TP
diff --git a/dwm.c b/dwm.c
index d9e1c7f..3dc6f84 100644
--- a/dwm.c
+++ b/dwm.c
@@ -145,7 +145,7 @@ void initfont(const char *fontstr);
145Bool isoccupied(unsigned int t); 145Bool isoccupied(unsigned int t);
146Bool isprotodel(Client *c); 146Bool isprotodel(Client *c);
147Bool isurgent(unsigned int t); 147Bool isurgent(unsigned int t);
148Bool isvisible(Client *c, Bool *cmp); 148Bool isvisible(Client *c);
149void keypress(XEvent *e); 149void keypress(XEvent *e);
150void killclient(const char *arg); 150void killclient(const char *arg);
151void manage(Window w, XWindowAttributes *wa); 151void manage(Window w, XWindowAttributes *wa);
@@ -261,7 +261,7 @@ arrange(void) {
261 Client *c; 261 Client *c;
262 262
263 for(c = clients; c; c = c->next) 263 for(c = clients; c; c = c->next)
264 if(isvisible(c, NULL)) { 264 if(isvisible(c)) {
265 unban(c); 265 unban(c);
266 if(!lt->arrange || c->isfloating) 266 if(!lt->arrange || c->isfloating)
267 resize(c, c->x, c->y, c->w, c->h, True); 267 resize(c, c->x, c->y, c->w, c->h, True);
@@ -441,7 +441,7 @@ configurerequest(XEvent *e) {
441 if((ev->value_mask & (CWX|CWY)) 441 if((ev->value_mask & (CWX|CWY))
442 && !(ev->value_mask & (CWWidth|CWHeight))) 442 && !(ev->value_mask & (CWWidth|CWHeight)))
443 configure(c); 443 configure(c);
444 if(isvisible(c, NULL)) 444 if(isvisible(c))
445 XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); 445 XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
446 } 446 }
447 else 447 else
@@ -494,7 +494,7 @@ drawbar(void) {
494 Client *c; 494 Client *c;
495 495
496 dc.x = 0; 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 for(i = 0; i < LENGTH(tags); i++) { 498 for(i = 0; i < LENGTH(tags); i++) {
499 dc.w = textw(tags[i]); 499 dc.w = textw(tags[i]);
500 if(tagset[seltags][i]) { 500 if(tagset[seltags][i]) {
@@ -634,8 +634,8 @@ expose(XEvent *e) {
634 634
635void 635void
636focus(Client *c) { 636focus(Client *c) {
637 if(!c || (c && !isvisible(c, NULL))) 637 if(!c || (c && !isvisible(c)))
638 for(c = stack; c && !isvisible(c, NULL); c = c->snext); 638 for(c = stack; c && !isvisible(c); c = c->snext);
639 if(sel && sel != c) { 639 if(sel && sel != c) {
640 grabbuttons(sel, False); 640 grabbuttons(sel, False);
641 XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]); 641 XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
@@ -669,9 +669,9 @@ focusnext(const char *arg) {
669 669
670 if(!sel) 670 if(!sel)
671 return; 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 if(!c) 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 if(c) { 675 if(c) {
676 focus(c); 676 focus(c);
677 restack(); 677 restack();
@@ -684,10 +684,10 @@ focusprev(const char *arg) {
684 684
685 if(!sel) 685 if(!sel)
686 return; 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 if(!c) { 688 if(!c) {
689 for(c = clients; c && c->next; c = c->next); 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 if(c) { 692 if(c) {
693 focus(c); 693 focus(c);
@@ -888,13 +888,11 @@ isurgent(unsigned int t) {
888} 888}
889 889
890Bool 890Bool
891isvisible(Client *c, Bool *cmp) { 891isvisible(Client *c) {
892 unsigned int i; 892 unsigned int i;
893 893
894 if(!cmp)
895 cmp = tagset[seltags];
896 for(i = 0; i < LENGTH(tags); i++) 894 for(i = 0; i < LENGTH(tags); i++)
897 if(c->tags[i] && cmp[i]) 895 if(c->tags[i] && tagset[seltags][i])
898 return True; 896 return True;
899 return False; 897 return False;
900} 898}
@@ -1019,7 +1017,7 @@ monocle(void) {
1019 Client *c; 1017 Client *c;
1020 1018
1021 for(c = clients; c; c = c->next) 1019 for(c = clients; c; c = c->next)
1022 if(!c->isfloating && isvisible(c, NULL)) 1020 if(!c->isfloating && isvisible(c))
1023 resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, RESIZEHINTS); 1021 resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, RESIZEHINTS);
1024} 1022}
1025 1023
@@ -1070,7 +1068,7 @@ movemouse(Client *c) {
1070 1068
1071Client * 1069Client *
1072nextunfloating(Client *c) { 1070nextunfloating(Client *c) {
1073 for(; c && (c->isfloating || !isvisible(c, NULL)); c = c->next); 1071 for(; c && (c->isfloating || !isvisible(c)); c = c->next);
1074 return c; 1072 return c;
1075} 1073}
1076 1074
@@ -1230,7 +1228,7 @@ restack(void) {
1230 wc.stack_mode = Below; 1228 wc.stack_mode = Below;
1231 wc.sibling = barwin; 1229 wc.sibling = barwin;
1232 for(c = stack; c; c = c->snext) 1230 for(c = stack; c; c = c->snext)
1233 if(!c->isfloating && isvisible(c, NULL)) { 1231 if(!c->isfloating && isvisible(c)) {
1234 XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc); 1232 XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
1235 wc.sibling = c->win; 1233 wc.sibling = c->win;
1236 } 1234 }