[xserver-commit] xserver/hw/kdrive/src kdrive.h,1.49,1.50 kinput.c,1.37,1.38

Jaymz Julian xserver-commit@pdx.freedesktop.org


Committed by: jaymz

Update of /cvs/xserver/xserver/hw/kdrive/src
In directory pdx:/tmp/cvs-serv16719/hw/kdrive/src

Modified Files:
	kdrive.h kinput.c 
Log Message:
Polling input mode for the kdrive os layer.  And a moose!



Index: kdrive.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kdrive.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- kdrive.h	8 Jan 2004 08:16:24 -0000	1.49
+++ kdrive.h	5 Feb 2004 09:09:51 -0000	1.50
@@ -276,6 +276,7 @@
     Bool	    (*SpecialKey) (KeySym);
     void	    (*Disable) (void);
     void	    (*Fini) (void);
+    void	    (*pollEvents) (void);
 } KdOsFuncs;
 
 typedef enum _KdSyncPolarity {

Index: kinput.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kinput.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- kinput.c	5 Nov 2003 06:46:13 -0000	1.37
+++ kinput.c	5 Feb 2004 09:09:51 -0000	1.38
@@ -1468,7 +1468,8 @@
 		pointer		readmask)
 {
     KdMouseInfo		    *mi;
-    
+    int myTimeout=0;
+
     for (mi = kdMouseInfo; mi; mi = mi->next)
     {
 	if (mi->timeoutPending)
@@ -1476,11 +1477,20 @@
 	    int	ms;
     
 	    ms = mi->emulationTimeout - GetTimeInMillis ();
-	    if (ms < 0)
-		ms = 0;
-	    AdjustWaitForDelay (timeout, ms);
+	    if (ms < 1)
+		ms = 1;
+	    if(ms<myTimeout || myTimeout==0)
+		    myTimeout=ms;
 	}
     }
+    /* if we need to poll for events, do that */
+    if(kdOsFuncs->pollEvents)
+    {
+	    (*kdOsFuncs->pollEvents)();
+	    myTimeout=20;
+    }
+    if(myTimeout>0)
+    	AdjustWaitForDelay (timeout, myTimeout);
 }
 
 void