[PATCH 08/19] xfree86: remove XI86_CONFIGURED flag.
Peter Hutterer
peter.hutterer at who-t.net
Thu Jul 29 23:21:24 PDT 2010
PreInit returns a status code. Let's use that instead of having it report
Success in some cases but not set the XI86_CONFIGURED flag and thus signal
an init failure.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
hw/xfree86/common/xf86Xinput.c | 52 ++++++++++++++++-----------------------
hw/xfree86/common/xf86Xinput.h | 1 -
2 files changed, 21 insertions(+), 32 deletions(-)
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 0a0de8e..1f095d4 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -333,36 +333,32 @@ xf86ActivateDevice(LocalDevicePtr local)
{
DeviceIntPtr dev;
- if (local->flags & XI86_CONFIGURED) {
- dev = AddInputDevice(serverClient, local->device_control, TRUE);
+ dev = AddInputDevice(serverClient, local->device_control, TRUE);
- if (dev == NULL)
- {
- xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n",
- local->name);
- local->dev = NULL;
- return FALSE;
- }
+ if (dev == NULL)
+ {
+ xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n",
+ local->name);
+ local->dev = NULL;
+ return FALSE;
+ }
- local->atom = MakeAtom(local->type_name,
- strlen(local->type_name),
- TRUE);
- AssignTypeAndName(dev, local->atom, local->name);
- dev->public.devicePrivate = (pointer) local;
- local->dev = dev;
-
- dev->coreEvents = local->flags & XI86_ALWAYS_CORE;
- dev->type = SLAVE;
- dev->spriteInfo->spriteOwner = FALSE;
+ local->atom = MakeAtom(local->type_name, strlen(local->type_name), TRUE);
+ AssignTypeAndName(dev, local->atom, local->name);
+ dev->public.devicePrivate = local;
+ local->dev = dev;
- dev->config_info = xf86SetStrOption(local->options, "config_info", NULL);
+ dev->coreEvents = local->flags & XI86_ALWAYS_CORE;
+ dev->type = SLAVE;
+ dev->spriteInfo->spriteOwner = FALSE;
- XkbSetExtension(dev, ProcessKeyboardEvent);
+ dev->config_info = xf86SetStrOption(local->options, "config_info", NULL);
- if (serverGeneration == 1)
- xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",
- local->name, local->type_name);
- }
+ XkbSetExtension(dev, ProcessKeyboardEvent);
+
+ if (serverGeneration == 1)
+ xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",
+ local->name, local->type_name);
return TRUE;
}
@@ -786,12 +782,6 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable)
xf86Msg(X_ERROR, "PreInit returned %d for \"%s\"\n", rval, idev->identifier);
goto unwind;
}
- else if (!(pInfo->flags & XI86_CONFIGURED)) {
- xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n",
- idev->identifier);
- rval = BadMatch;
- goto unwind;
- }
if (!xf86ActivateDevice(pInfo))
{
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 1b71c64..7528a51 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -59,7 +59,6 @@
#include "XIstubs.h"
/* Input device flags */
-#define XI86_CONFIGURED 0x02 /* the device has been configured */
#define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */
/* the device sends Xinput and core pointer events */
#define XI86_SEND_CORE_EVENTS XI86_ALWAYS_CORE
--
1.7.2
More information about the xorg-devel
mailing list