diff --git a/sys/src/cmd/aux/kbdfs.c b/sys/src/cmd/aux/kbdfs.c index 46939f925..a346cee8e 100644 --- a/sys/src/cmd/aux/kbdfs.c +++ b/sys/src/cmd/aux/kbdfs.c @@ -400,7 +400,8 @@ consproc(void *) x = buf + n; while(p < x && fullrune(p, x - p)){ p += chartorune(&r, p); - send(rawchan, &r); + if(r) + send(rawchan, &r); } n = x - p; if(n > 0){ diff --git a/sys/src/cmd/rio/rio.c b/sys/src/cmd/rio/rio.c index 91cbe6086..6912bbb0a 100644 --- a/sys/src/cmd/rio/rio.c +++ b/sys/src/cmd/rio/rio.c @@ -337,6 +337,7 @@ keyboardthread(void*) char *s; threadsetname("keyboardthread"); + while(s = recvp(kbdchan)){ if(input == nil || sendp(input->ck, s) <= 0) free(s); @@ -360,8 +361,10 @@ keyboardsend(char *s, int cnt) r = runemalloc(cnt); cvttorunes(s, cnt, r, &nb, &nr, nil); for(i=0; i 0){ @@ -1252,15 +1257,15 @@ Channel* initkbd(void) { Channel *c; - char *err; + char *e; c = chancreate(sizeof(char*), 16); - proccreate(kbdioproc, c, STACK); - if(err = recvp(c)){ + proccreate(kbdproc, c, STACK); + if(e = recvp(c)){ chanfree(c); - werrstr(err); - free(err); - return nil; + c = nil; + werrstr(e); + free(e); } return c; } diff --git a/sys/src/cmd/rio/wind.c b/sys/src/cmd/rio/wind.c index 2690fa998..aec2c19ac 100644 --- a/sys/src/cmd/rio/wind.c +++ b/sys/src/cmd/rio/wind.c @@ -23,7 +23,6 @@ enum static int topped; static int id; -static int reverse; static Image *cols[NCOL]; static Image *grey; @@ -31,7 +30,6 @@ static Image *darkgrey; static Cursor *lastcursor; static Image *titlecol; static Image *lighttitlecol; -static Image *dholdcol; static Image *holdcol; static Image *lightholdcol; static Image *paleholdcol; @@ -43,36 +41,19 @@ wmk(Image *i, Mousectl *mc, Channel *ck, Channel *cctl, int scrolling) Rectangle r; if(cols[0] == nil){ - /* there are no pastel paints in the dungeons and dragons world - * - rob pike - */ - reverse = 0; - if(getenv("reverse") != nil) - reverse = ~0xFF; - /* greys are multiples of 0x11111100+0xFF, 14* being palest */ - grey = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xEEEEEEFF^reverse); - darkgrey = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x666666FF^reverse); - cols[BACK] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xFFFFFFFF^reverse); - cols[HIGH] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xCCCCCCFF^reverse); + grey = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xEEEEEEFF); + darkgrey = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x666666FF); + cols[BACK] = display->white; + cols[HIGH] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xCCCCCCFF); cols[BORD] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x999999FF); - cols[TEXT] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x000000FF^reverse); - cols[HTEXT] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x000000FF^reverse); - if(reverse == 0) { - titlecol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DGreygreen); - lighttitlecol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DPalegreygreen); - } else { - titlecol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DPurpleblue); - lighttitlecol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x666666FF^reverse); - } - dholdcol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DMedblue); + cols[TEXT] = display->black; + cols[HTEXT] = display->black; + titlecol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DGreygreen); + lighttitlecol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DPalegreygreen); + holdcol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DMedblue); lightholdcol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DGreyblue); paleholdcol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DPalegreyblue); - - if(reverse == 0) - holdcol = dholdcol; - else - holdcol = paleholdcol; } w = emalloc(sizeof(Window)); w->screenr = i->r; @@ -623,8 +604,8 @@ wkeyctl(Window *w, Rune r) if(w->deleted) return; - /* navigation keys work only when mouse is not open */ - if(!w->mouseopen) + /* navigation keys work only when mouse and kbd is not open */ + if(!w->mouseopen && !w->kbdopen) switch(r){ case Kdown: n = w->maxlines/3; @@ -759,7 +740,7 @@ wsetcols(Window *w) w->cols[TEXT] = w->cols[HTEXT] = lightholdcol; else if(w == input) - w->cols[TEXT] = w->cols[HTEXT] = cols[TEXT]; + w->cols[TEXT] = w->cols[HTEXT] = display->black; else w->cols[TEXT] = w->cols[HTEXT] = darkgrey; } @@ -1360,6 +1341,7 @@ wclosewin(Window *w) if(hidden[i] == w){ --nhidden; memmove(hidden+i, hidden+i+1, (nhidden-i)*sizeof(hidden[0])); + hidden[nhidden] = nil; break; } for(i=0; i