removed viewnext/viewprev

This commit is contained in:
Anselm R.Garbe 2006-08-14 08:38:26 +02:00
parent 2c66b422e7
commit 4cb78a170c
6 changed files with 9 additions and 65 deletions

View File

@ -22,10 +22,8 @@ static Key key[] = { \
{ MODKEY, XK_1, view, { .i = 0 } }, \ { MODKEY, XK_1, view, { .i = 0 } }, \
{ MODKEY, XK_2, view, { .i = 1 } }, \ { MODKEY, XK_2, view, { .i = 1 } }, \
{ MODKEY, XK_3, view, { .i = 2 } }, \ { MODKEY, XK_3, view, { .i = 2 } }, \
{ MODKEY, XK_h, viewprev, { 0 } }, \
{ MODKEY, XK_j, focusnext, { 0 } }, \ { MODKEY, XK_j, focusnext, { 0 } }, \
{ MODKEY, XK_k, focusprev, { 0 } }, \ { MODKEY, XK_k, focusprev, { 0 } }, \
{ MODKEY, XK_l, viewnext, { 0 } }, \
{ MODKEY, XK_m, togglemax, { 0 } }, \ { MODKEY, XK_m, togglemax, { 0 } }, \
{ MODKEY, XK_p, spawn, \ { MODKEY, XK_p, spawn, \
{ .cmd = "exec `ls -lL /usr/bin /usr/local/bin 2>/dev/null | " \ { .cmd = "exec `ls -lL /usr/bin /usr/local/bin 2>/dev/null | " \

View File

@ -24,10 +24,8 @@ static Key key[] = { \
{ MODKEY, XK_2, view, { .i = 2 } }, \ { MODKEY, XK_2, view, { .i = 2 } }, \
{ MODKEY, XK_3, view, { .i = 3 } }, \ { MODKEY, XK_3, view, { .i = 3 } }, \
{ MODKEY, XK_4, view, { .i = 4 } }, \ { MODKEY, XK_4, view, { .i = 4 } }, \
{ MODKEY, XK_h, viewprev, { 0 } }, \
{ MODKEY, XK_j, focusnext, { 0 } }, \ { MODKEY, XK_j, focusnext, { 0 } }, \
{ MODKEY, XK_k, focusprev, { 0 } }, \ { MODKEY, XK_k, focusprev, { 0 } }, \
{ MODKEY, XK_l, viewnext, { 0 } }, \
{ MODKEY, XK_m, togglemax, { 0 } }, \ { MODKEY, XK_m, togglemax, { 0 } }, \
{ MODKEY, XK_space, togglemode, { 0 } }, \ { MODKEY, XK_space, togglemode, { 0 } }, \
{ MODKEY, XK_Return, zoom, { 0 } }, \ { MODKEY, XK_Return, zoom, { 0 } }, \

16
dwm.1
View File

@ -43,14 +43,6 @@ click on a tag label focuses that
.B Button2 .B Button2
click on a tag label toggles that click on a tag label toggles that
.B tag. .B tag.
.TP
.B Button[1,4]
click on the bar focuses the previous
.B tag.
.TP
.B Button[2,5]
click on the bar focuses the next
.B tag.
.SS Keyboard commands .SS Keyboard commands
.TP .TP
.B Mod1-Return .B Mod1-Return
@ -60,10 +52,6 @@ to the
.B master .B master
column. column.
.TP .TP
.B Mod1-h
Focus previous
.B tag.
.TP
.B Mod1-j .B Mod1-j
Focus next Focus next
.B window. .B window.
@ -72,10 +60,6 @@ Focus next
Focus previous Focus previous
.B window. .B window.
.TP .TP
.B Mod1-l
Focus next
.B tag.
.TP
.B Mod1-m .B Mod1-m
Maximize current Maximize current
.B window. .B window.

2
dwm.h
View File

@ -129,8 +129,6 @@ extern void settags(Client *c);
extern void togglemode(Arg *arg); extern void togglemode(Arg *arg);
extern void view(Arg *arg); extern void view(Arg *arg);
extern void toggleview(Arg *arg); extern void toggleview(Arg *arg);
extern void viewnext(Arg *arg);
extern void viewprev(Arg *arg);
/* util.c */ /* util.c */
extern void *emallocz(unsigned int size); extern void *emallocz(unsigned int size);

32
event.c
View File

@ -102,30 +102,16 @@ buttonpress(XEvent *e)
XButtonPressedEvent *ev = &e->xbutton; XButtonPressedEvent *ev = &e->xbutton;
if(barwin == ev->window) { if(barwin == ev->window) {
switch(ev->button) { x = 0;
default: for(a.i = 0; a.i < ntags; a.i++) {
x = 0; x += textw(tags[a.i]);
for(a.i = 0; a.i < ntags; a.i++) { if(ev->x < x) {
x += textw(tags[a.i]); if(ev->button == Button3)
if(ev->x < x) { toggleview(&a);
if(ev->button == Button3) else
toggleview(&a); view(&a);
else return;
view(&a);
return;
}
} }
if(ev->button == Button1)
viewprev(&a);
else if(ev->button == Button3)
viewnext(&a);
break;
case Button4:
viewprev(&a);
break;
case Button5:
viewnext(&a);
break;
} }
} }
else if((c = getclient(ev->window))) { else if((c = getclient(ev->window))) {

20
tag.c
View File

@ -263,23 +263,3 @@ toggleview(Arg *arg)
arrange(NULL); arrange(NULL);
drawall(); drawall();
} }
void
viewnext(Arg *arg)
{
unsigned int i;
for(i = 0; !seltag[i]; i++);
arg->i = (i < ntags-1) ? i+1 : 0;
view(arg);
}
void
viewprev(Arg *arg)
{
unsigned int i;
for(i = 0; !seltag[i]; i++);
arg->i = (i > 0) ? i-1 : ntags-1;
view(arg);
}