Hello,
attached is a patch that solves - at least for me - some of the input
problems that I experienced with libgii on KII. I think the fix sounds
reasonable, and it is just a re-import of some of the other input targets
(I looked at linux_kbd for comparison for example).
Please commit if you find it adequate. (I've just realized that my LibGGI
CVS tree is from anoncvs, I'll need to recheckout entirely to enable
developer access.)
Rodolphe
PS: Btw, working with two screens is *really* addictive when
comparing files. :-)
Index: input.c
===================================================================
RCS file: /cvsroot/ggi/ggi-core/libgii/input/kii/input.c,v
retrieving revision 1.5
diff -u -r1.5 input.c
--- input.c 30 Nov 2002 15:32:22 -0000 1.5
+++ input.c 5 Dec 2002 21:06:40 -0000
@@ -205,6 +205,27 @@
gii_event_mask em = emZero;
gii_event ge;
+ /* FIXME: Maybe we should handle eof condition? -- ortalo */
+
+ if (arg == NULL) {
+
+ fd_set fds = inp->fdset;
+ struct timeval tv = { 0, 0 };
+ if (select(inp->maxfd, &fds, NULL, NULL, &tv) <= 0) {
+
+ return emZero;
+ }
+ } else {
+
+ if (! FD_ISSET(kiiEventDeviceFD(KII_CTX(inp)), ((fd_set*)arg))) {
+
+ /* Nothing to read on the fd set */
+ GIIDPRINT_EVENTS("GII_kii_poll: dummy poll\n");
+ return emZero;
+ }
+ }
+
+ /* Now we are sure there is data. kiiEventAvailable() may block */
if (!kiiEventAvailable(KII_CTX(inp))) {
return emZero;
@@ -319,6 +340,7 @@
inp->curreventmask = emAll;
inp->maxfd = kiiEventDeviceFD(KII_CTX(inp)) + 1;
+ FD_SET(kiiEventDeviceFD(KII_CTX(inp)), &inp->fdset);
GIIDPRINT_MISC("kii fully up\n");