summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-11-21 12:39:55 +1000
committerPeter Hutterer <peter.hutterer@redhat.com>2008-11-24 10:17:40 +1000
commite078901a4eca02bd3e7a80d9462dafbca939a187 (patch)
treee0eef41c1f6afec8835212a106d56e9e77e80e45
parentd939f2482e71ad20bac28b7aa4b2e8c8196e9d65 (diff)
dix: Enable core devices in InitCoreDevices already.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--dix/devices.c29
-rw-r--r--dix/main.c3
-rw-r--r--include/input.h2
3 files changed, 10 insertions, 24 deletions
diff --git a/dix/devices.c b/dix/devices.c
index b179ce332..33b723a4f 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);
+
}
/**
@@ -619,7 +623,7 @@ InitCoreDevices(void)
*
* @return Success or error code on failure.
*/
-int
+void
InitAndStartDevices()
{
DeviceIntPtr dev, next;
@@ -630,31 +634,14 @@ 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)
{
DebugF("(dix) enabling device %d\n", dev->id);
next = dev->next;
if (dev->inited && dev->startup)
- (void)EnableDevice(dev);
+ EnableDevice(dev);
}
-
- return Success;
}
/**
diff --git a/dix/main.c b/dix/main.c
index 7bd91e0c2..ee2e10db5 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);
diff --git a/include/input.h b/include/input.h
index a41affd21..30457f35f 100644
--- a/include/input.h
+++ b/include/input.h
@@ -239,7 +239,7 @@ extern Bool ActivateDevice(
extern Bool DisableDevice(
DeviceIntPtr /*device*/);
-extern int InitAndStartDevices(void);
+extern void InitAndStartDevices(void);
extern void CloseDownDevices(void);