rio: dont serve a kbd file per window when we didnt got one from the environment
9vx doesnt provide a /dev/kbd file and rio faking one up causes problems with vncv. (issue #223)
This commit is contained in:
parent
88486c7529
commit
c38cd50805
|
@ -337,6 +337,7 @@ Window *wkeyboard; /* window of simulated keyboard */
|
||||||
int nwindow;
|
int nwindow;
|
||||||
int snarffd;
|
int snarffd;
|
||||||
int gotscreen;
|
int gotscreen;
|
||||||
|
int servekbd;
|
||||||
Window *input;
|
Window *input;
|
||||||
QLock all; /* BUG */
|
QLock all; /* BUG */
|
||||||
Filsys *filsys;
|
Filsys *filsys;
|
||||||
|
|
|
@ -365,6 +365,8 @@ skipdir(char *name)
|
||||||
return 1;
|
return 1;
|
||||||
if(gotscreen && strcmp(name, "screen")==0)
|
if(gotscreen && strcmp(name, "screen")==0)
|
||||||
return 1;
|
return 1;
|
||||||
|
if(!servekbd && strcmp(name, "kbd")==0)
|
||||||
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1340,6 +1340,9 @@ kbdproc(void *arg)
|
||||||
if((kfd = open("/dev/kbd", OREAD)) >= 0){
|
if((kfd = open("/dev/kbd", OREAD)) >= 0){
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
|
/* only serve a kbd file per window when we got one */
|
||||||
|
servekbd = 1;
|
||||||
|
|
||||||
/* read kbd state */
|
/* read kbd state */
|
||||||
while((n = read(kfd, buf, sizeof(buf))) > 0)
|
while((n = read(kfd, buf, sizeof(buf))) > 0)
|
||||||
chanprint(c, "%.*s", n, buf);
|
chanprint(c, "%.*s", n, buf);
|
||||||
|
|
Loading…
Reference in a new issue