[PATCH] dix: Enable core devices in InitCoreDevices already.

Peter Hutterer peter.hutterer at who-t.net
Thu Nov 20 21:03:16 PST 2008


From: Peter Hutterer <peter.hutterer at redhat.com>

Signed-off-by: Peter Hutterer <peter.hutterer at redhat.com>
---
 dix/devices.c |   23 ++++++-----------------
 dix/main.c    |    3 +--
 2 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/dix/devices.c b/dix/devices.c
index b179ce3..8daaa75 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -593,8 +593,6 @@ CorePointerProc(DeviceIntPtr pDev, int what)
  * Both devices are not tied to physical devices, but guarantee that there is
  * always a keyboard and a pointer present and keep the protocol semantics.
  *
- * The devices are activated but not enabled.
- *
  * Note that the server MUST have two core devices at all times, even if there
  * is no physical device connected.
  */
@@ -605,6 +603,12 @@ InitCoreDevices(void)
                           &inputInfo.pointer,
                           &inputInfo.keyboard) != Success)
         FatalError("Failed to allocate core devices");
+
+    if (inputInfo.pointer->inited && inputInfo.pointer->startup)
+        EnableDevice(inputInfo.pointer);
+    if (inputInfo.keyboard->inited && inputInfo.keyboard->startup)
+        EnableDevice(inputInfo.keyboard);
+
 }
 
 /**
@@ -630,21 +634,6 @@ InitAndStartDevices()
             ActivateDevice(dev);
     }
 
-    if (!inputInfo.keyboard) { /* In theory, this cannot happen */
-	ErrorF("[dix] No core keyboard\n");
-	return BadImplementation;
-    }
-    if (!inputInfo.pointer) { /* In theory, this cannot happen */
-	ErrorF("[dix] No core pointer\n");
-	return BadImplementation;
-    }
-
-    /* Now enable all devices */
-    if (inputInfo.pointer->inited && inputInfo.pointer->startup)
-        EnableDevice(inputInfo.pointer);
-    if (inputInfo.keyboard->inited && inputInfo.keyboard->startup)
-        EnableDevice(inputInfo.keyboard);
-
     /* enable real devices */
     for (dev = inputInfo.off_devices; dev; dev = next)
     {
diff --git a/dix/main.c b/dix/main.c
index 7bd91e0..ee2e10d 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -361,8 +361,7 @@ int main(int argc, char *argv[], char *envp[])
 
         InitCoreDevices();
 	InitInput(argc, argv);
-	if (InitAndStartDevices() != Success)
-	    FatalError("failed to initialize core devices");
+	InitAndStartDevices();
 
 	dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
 
-- 
1.6.0.3




More information about the xorg mailing list