xserver: Branch 'master'

Julien Cristau jcristau at kemper.freedesktop.org
Sat Aug 11 18:14:21 PDT 2007


 hw/xfree86/os-support/hurd/hurd_mouse.c |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletion(-)

New commits:
diff-tree 03f9da672466b9ab9a9814d784b8c44f1030587e (from c5741438a3a171f493e9da32a6b39f73403f6993)
Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
Date:   Sun Aug 12 03:07:04 2007 +0200

    xfree86: Improve default mouse handling on the Hurd
    
    Make /dev/mouse the default device.  This makes Xorg works with empty
    or missing InputDevice sections.

diff --git a/hw/xfree86/os-support/hurd/hurd_mouse.c b/hw/xfree86/os-support/hurd/hurd_mouse.c
index 5f6d943..089cba3 100644
--- a/hw/xfree86/os-support/hurd/hurd_mouse.c
+++ b/hw/xfree86/os-support/hurd/hurd_mouse.c
@@ -46,6 +46,8 @@
 #include <mach.h>
 #include <sys/ioctl.h>
 
+#define DEFAULT_MOUSE_DEV	"/dev/mouse"
+
 typedef unsigned short kev_type;		/* kd event type */
 typedef unsigned char Scancode;
 
@@ -166,6 +168,26 @@ OsMousePreInit(InputInfoPtr pInfo, const
     return TRUE;
 }
 
+static const char *
+FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+    const char path[] = DEFAULT_MOUSE_DEV;
+    int fd;
+
+    SYSCALL (fd = open(path, O_RDWR | O_NONBLOCK | O_EXCL));
+
+    if (fd == -1)
+	return NULL;
+
+    close(fd);
+    pInfo->conf_idev->commonOptions =
+	xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", path);
+    xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n", pInfo->name,
+	    path);
+
+    return path;
+}
+
 static int
 SupportedInterfaces(void)
 {
@@ -195,7 +217,6 @@ CheckProtocol(const char *protocol)
     return FALSE;
 }
 
-/* XXX Is this appropriate?  If not, this function should be removed. */
 static const char *
 DefaultProtocol(void)
 {
@@ -212,6 +233,7 @@ xf86OSMouseInit(int flags)
 	return NULL;
     p->SupportedInterfaces = SupportedInterfaces;
     p->BuiltinNames = BuiltinNames;
+    p->FindDevice = FindDevice;
     p->DefaultProtocol = DefaultProtocol;
     p->CheckProtocol = CheckProtocol;
     p->PreInit = OsMousePreInit;


More information about the xorg-commit mailing list