From c38cd508057ab0abda846ed13786d56d627db7e2 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 25 Oct 2014 02:05:44 +0200 Subject: [PATCH] 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) --- sys/src/cmd/rio/dat.h | 1 + sys/src/cmd/rio/fsys.c | 2 ++ sys/src/cmd/rio/rio.c | 3 +++ 3 files changed, 6 insertions(+) diff --git a/sys/src/cmd/rio/dat.h b/sys/src/cmd/rio/dat.h index 45159323d..6fba1af49 100644 --- a/sys/src/cmd/rio/dat.h +++ b/sys/src/cmd/rio/dat.h @@ -337,6 +337,7 @@ Window *wkeyboard; /* window of simulated keyboard */ int nwindow; int snarffd; int gotscreen; +int servekbd; Window *input; QLock all; /* BUG */ Filsys *filsys; diff --git a/sys/src/cmd/rio/fsys.c b/sys/src/cmd/rio/fsys.c index b0ae83b5e..94a35442f 100644 --- a/sys/src/cmd/rio/fsys.c +++ b/sys/src/cmd/rio/fsys.c @@ -365,6 +365,8 @@ skipdir(char *name) return 1; if(gotscreen && strcmp(name, "screen")==0) return 1; + if(!servekbd && strcmp(name, "kbd")==0) + return 1; return 0; } diff --git a/sys/src/cmd/rio/rio.c b/sys/src/cmd/rio/rio.c index 26b9b227d..5d7fe2e91 100644 --- a/sys/src/cmd/rio/rio.c +++ b/sys/src/cmd/rio/rio.c @@ -1340,6 +1340,9 @@ kbdproc(void *arg) if((kfd = open("/dev/kbd", OREAD)) >= 0){ close(fd); + /* only serve a kbd file per window when we got one */ + servekbd = 1; + /* read kbd state */ while((n = read(kfd, buf, sizeof(buf))) > 0) chanprint(c, "%.*s", n, buf);