Sorry I left the bitfield form in key.c, it should of course be: if(e->keycode == tabcode && (e->state&Mod1Mask) == Mod1Mask)
LGTM thanks. i'm taking this on faith as i don't have a convenient way to test it at the moment. i'm thrilled to finally have this. On Sat, Feb 13, 2010 at 07:18, <mathieu.lonjaret@gmail.com> wrote: > Reviewers: rsc, > > > > Please review this at http://codereview.appspot.com/207093/show > > Affected files: > M src/cmd/rio/client.c > M src/cmd/rio/key.c > > > Index: src/cmd/rio/client.c > =================================================================== > --- a/src/cmd/rio/client.c > +++ b/src/cmd/rio/client.c > @@ -257,15 +257,15 @@ > > if(clients == 0 || clients->next == 0) > return; > - if(up){ > + if(!up){ > + c = 0; > /*for(c=clients; c->next; c=c->next) */ > /* ; */ > for(l=&clients; (*l)->next; l=&(*l)->next) > - ; > - c = *l; > - *l = 0; > - c->next = clients; > - clients = c; > + if ((*l)->state == 1) > + c = *l; > + if (c == 0) > + return; > XMapRaised(dpy, c->parent); > top(c); > active(c); > Index: src/cmd/rio/key.c > =================================================================== > --- a/src/cmd/rio/key.c > +++ b/src/cmd/rio/key.c > @@ -17,7 +17,7 @@ > GrabAltAny > }; > > -static int tabcode = 0x17; > +/*static int tabcode = 0x17; */ > /*static int altcode = 0x40; */ > /*static int pgupcode = 0x63; */ > /*static int pgdowncode = 0x69; */ > @@ -28,6 +28,7 @@ > keysetup(void) > { > int i; > + int tabcode = XKeysymToKeycode(dpy, XK_Tab); > > for(i=0; i<num_screens; i++){ > XGrabKey(dpy, tabcode, Mod1Mask, screens[i].root, 0, > GrabModeSync, GrabModeAsync); > @@ -44,8 +45,8 @@ > /* > * process key press here > */ > - if(0) > - if(e->keycode == tabcode) > + int tabcode = XKeysymToKeycode(dpy, XK_Tab); > + if(e->keycode == tabcode && (e->state&Mod1Mask) == (1<<3)) > alttab(e->state&ShiftMask); > XAllowEvents(dpy, SyncKeyboard, e->time); > } > > >
*** Submitted as 09ff1ba4a9c5 *** rio: add alt-tab for cycling windows R=rsc CC=codebot http://codereview.appspot.com/207093 Committer: Russ Cox <rsc@swtch.com>