[xserver-commit] xserver/hw/kdrive/linux ts.c,1.17,1.18

Phil Blundell xserver-commit@pdx.freedesktop.org
Sat, 08 Nov 2003 10:52:01 -0800


Committed by: pb

Update of /cvs/xserver/xserver/hw/kdrive/linux
In directory pdx:/tmp/cvs-serv13690/hw/kdrive/linux

Modified Files:
	ts.c 
Log Message:
2003-11-08  Phil Blundell  <pb@nexus.co.uk>

	* configure.ac: Avoid ugly shell error when libXdmcp isn't
	present.

	* hw/kdrive/linux/ts.c (TsEnable, TsDisable): New functions.
	(TsInit): Register them.



Index: ts.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/linux/ts.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- ts.c	7 Nov 2003 23:00:06 -0000	1.17
+++ ts.c	8 Nov 2003 18:51:59 -0000	1.18
@@ -132,6 +132,20 @@
 int TsInputType;
 
 static int
+TsEnable (int fd, void *closure)
+{
+    KdMouseInfo *mi = (KdMouseInfo *)closure;
+
+    return open (mi->name, 0);
+}
+
+static void
+TsDisable (int fd, void *closure)
+{
+    close (fd);
+}
+
+static int
 TsInit (void)
 {
     int		i;
@@ -172,7 +186,12 @@
 		mi->driver = (void *) fd;
 		mi->inputType = TsInputType;
 		if (KdRegisterFd (TsInputType, fd, TsRead, (void *) mi))
+		{
+		    /* Set callbacks for vt switches etc */
+		    KdRegisterFdEnableDisable (fd, TsEnable, TsDisable);
+
 		    n++;
+		}
 	    }
 	    else
 		close (fd);