xfree86: remove XI86_CONFIGURED flag.
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@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
97a4acdac2
commit
7defd282be
|
@ -329,37 +329,33 @@ 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;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
dev->config_info = xf86SetStrOption(local->options, "config_info", NULL);
|
||||
|
||||
XkbSetExtension(dev, ProcessKeyboardEvent);
|
||||
|
||||
if (serverGeneration == 1)
|
||||
xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",
|
||||
local->name, local->type_name);
|
||||
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 = local;
|
||||
local->dev = dev;
|
||||
|
||||
dev->coreEvents = local->flags & XI86_ALWAYS_CORE;
|
||||
dev->type = SLAVE;
|
||||
dev->spriteInfo->spriteOwner = FALSE;
|
||||
|
||||
dev->config_info = xf86SetStrOption(local->options, "config_info", NULL);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -782,12 +778,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))
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user