diff --git a/Xi/exevents.c b/Xi/exevents.c index 35669061e..1bcc101a7 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -89,64 +89,12 @@ Bool ShouldFreeInputMasks(WindowPtr /* pWin */ , static Bool MakeInputMasks(WindowPtr /* pWin */ ); -static int xiDevPrivateIndex = 0; -static int _xiServerGeneration = -1; - -typedef struct { - ProcessInputProc processInputProc; - ProcessInputProc realInputProc; -} xiDevPrivateRec, *xiDevPrivatePtr; - -/************************************************************************** - * - * Procedures for extension device event routing. - * - */ - -#define WRAP_PROCESS_INPUT_PROC(device, saveprocs, newproc) \ - saveprocs->processInputProc = \ - saveprocs->realInputProc = device->public.realInputProc; \ - device->public.processInputProc = newproc; \ - device->public.realInputProc = newproc - -#define UNWRAP_PROCESS_INPUT_PROC(device, saveprocs, backupproc) \ - backupproc = device->public.processInputProc; \ - device->public.processInputProc = saveprocs->processInputProc; \ - device->public.realInputProc = saveprocs->realInputProc; - -#define REWRAP_PROCESS_INPUT_PROC(device, saveprocs, newproc) \ - if (device->public.processInputProc == device->public.realInputProc) \ - device->public.processInputProc = newproc; \ - saveprocs->processInputProc = \ - saveprocs->realInputProc = device->public.realInputProc; \ - device->public.realInputProc = newproc; void RegisterOtherDevice(DeviceIntPtr device) { - xiDevPrivatePtr xiPrivPtr; - - if (serverGeneration != _xiServerGeneration) - { - xiDevPrivateIndex = AllocateDevicePrivateIndex(); - if (xiDevPrivateIndex == 1) - { - FatalError("[Xi] Could not allocate private index.\n"); - } - _xiServerGeneration = serverGeneration; - } - - if (!AllocateDevicePrivate(device, xiDevPrivateIndex)) - FatalError("[Xi] Dev private allocation failed.\n"); - - - xiPrivPtr = (xiDevPrivatePtr)xcalloc(1, sizeof(xiDevPrivateRec)); - if (!xiPrivPtr) - FatalError("[Xi] Cannot get memory for dev private.\n"); - - device->devPrivates[xiDevPrivateIndex].ptr = xiPrivPtr; - - WRAP_PROCESS_INPUT_PROC(device, xiPrivPtr, ProcessOtherEvent); + device->public.processInputProc = ProcessOtherEvent; + device->public.realInputProc = ProcessOtherEvent; } /** diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index a43230e14..a458c1119 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -181,24 +181,10 @@ xf86ActivateDevice(LocalDevicePtr local) if (DeviceIsPointerType(dev)) { -#ifdef XKB - dev->public.processInputProc = CoreProcessPointerEvent; - dev->public.realInputProc = CoreProcessPointerEvent; -#else - dev->public.processInputProc = ProcessPointerEvent; - dev->public.realInputProc = ProcessPointerEvent; -#endif dev->deviceGrab.ActivateGrab = ActivatePointerGrab; dev->deviceGrab.DeactivateGrab = DeactivatePointerGrab; } else { -#ifdef XKB - dev->public.processInputProc = CoreProcessKeyboardEvent; - dev->public.realInputProc = CoreProcessKeyboardEvent; -#else - dev->public.processInputProc = ProcessKeyboardEvent; - dev->public.realInputProc = ProcessKeyboardEvent; -#endif dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab; dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; }