From 4bc2761ad5ec2d0668aec639780ffb136605fbc8 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 4 Nov 2011 14:16:37 +1000 Subject: [PATCH] dix: switch the dev->deviceGrab.activeGrab from GrabRec to GrabPtr This breaks the input ABI. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas --- dix/devices.c | 3 +++ dix/events.c | 8 ++++---- include/inputstr.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dix/devices.c b/dix/devices.c index 37cbcdb78..e448eab62 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -73,6 +73,7 @@ SOFTWARE. #include "dixevents.h" #include "mipointer.h" #include "eventstr.h" +#include "dixgrabs.h" #include #include @@ -273,6 +274,7 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) dev->deviceGrab.grabTime = currentTime; dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab; dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; + dev->deviceGrab.activeGrab = AllocGrab(); XkbSetExtension(dev, ProcessKeyboardEvent); @@ -941,6 +943,7 @@ CloseDevice(DeviceIntPtr dev) } } + FreeGrab(dev->deviceGrab.activeGrab); free(dev->deviceGrab.sync.event); free(dev->config_info); /* Allocated in xf86ActivateDevice. */ free(dev->last.scroll); diff --git a/dix/events.c b/dix/events.c index bd7e93b6c..8f8531cf1 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1509,8 +1509,8 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab, grabinfo->grabTime = time; if (grab->cursor) grab->cursor->refcnt++; - CopyGrab(&grabinfo->activeGrab, grab); - grabinfo->grab = &grabinfo->activeGrab; + CopyGrab(grabinfo->activeGrab, grab); + grabinfo->grab = grabinfo->activeGrab; grabinfo->fromPassiveGrab = isPassive; grabinfo->implicitGrab = autoGrab & ImplicitGrabMask; PostNewCursor(mouse); @@ -1586,8 +1586,8 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool pass grabinfo->grabTime = syncEvents.time; else grabinfo->grabTime = time; - CopyGrab(&grabinfo->activeGrab, grab); - grabinfo->grab = &grabinfo->activeGrab; + CopyGrab(grabinfo->activeGrab, grab); + grabinfo->grab = grabinfo->activeGrab; grabinfo->fromPassiveGrab = passive; grabinfo->implicitGrab = passive & ImplicitGrabMask; CheckGrabForSyncs(keybd, (Bool)grab->keyboardMode, (Bool)grab->pointerMode); diff --git a/include/inputstr.h b/include/inputstr.h index 0568e0c9d..f9cb8fe0f 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -451,7 +451,7 @@ typedef struct _GrabInfoRec { TimeStamp grabTime; Bool fromPassiveGrab; /* true if from passive grab */ Bool implicitGrab; /* implicit from ButtonPress */ - GrabRec activeGrab; + GrabPtr activeGrab; GrabPtr grab; CARD8 activatingKey; void (*ActivateGrab) (