From 47a89b1cba67a43ddc225f7e1b5d2b3b217c8d93 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 20 May 2009 13:59:22 +1000 Subject: [PATCH] Xi: remove DeviceIsPointerType This approach is broken anyway. DIPT only checked for the XInput type "MOUSE" and the only user of this is xf86ActivateDevice when it sets the Activate/DeactivateGrab functions. Since synaptics and wacom set their own types, evdev only sets MOUSE for, well, mice half the devices didn't have this set correctly anyway. Instead, ActivatePointerGrab should be merged together with ActivateKeyboardGrab. Signed-off-by: Peter Hutterer --- Xi/extinit.c | 15 --------------- hw/xfree86/common/xf86Xinput.c | 11 ++--------- include/extinit.h | 5 ----- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/Xi/extinit.c b/Xi/extinit.c index b8280106a..1f7772911 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -1069,21 +1069,6 @@ IResetProc(ExtensionEntry * unused) RestoreExtensionEvents(); } -/***************************************************************** - * - * Returns TRUE if the device has some sort of pointer type. - * - */ - -Bool -DeviceIsPointerType(DeviceIntPtr dev) -{ - if (dev_type[1].type == dev->type) - return TRUE; - - return FALSE; -} - /*********************************************************************** * diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index aa98dad1a..6df0b8af2 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -326,15 +326,8 @@ xf86ActivateDevice(LocalDevicePtr local) dev->isMaster = FALSE; dev->spriteInfo->spriteOwner = FALSE; - if (DeviceIsPointerType(dev)) - { - dev->deviceGrab.ActivateGrab = ActivatePointerGrab; - dev->deviceGrab.DeactivateGrab = DeactivatePointerGrab; - } else - { - dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab; - dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; - } + dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab; + dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; RegisterOtherDevice(dev); XkbSetExtension(dev, ProcessKeyboardEvent); diff --git a/include/extinit.h b/include/extinit.h index 340433a83..0b36d3bcd 100644 --- a/include/extinit.h +++ b/include/extinit.h @@ -37,11 +37,6 @@ XInputExtensionInit( void ); -extern _X_EXPORT Bool -DeviceIsPointerType( - DeviceIntPtr dev - ); - extern _X_EXPORT void AssignTypeAndName ( DeviceIntPtr /* dev */,