[PATCH 10/12] dix: switch the dev->deviceGrab.activeGrab from GrabRec to GrabPtr

Peter Hutterer peter.hutterer at who-t.net
Mon Nov 7 13:39:14 PST 2011


This breaks the input ABI.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 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 da817a8..5962bbf 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 <X11/extensions/XI.h>
 #include <X11/extensions/XI2.h>
@@ -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 4bc6aaa..cb18d8d 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1510,8 +1510,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);
@@ -1587,8 +1587,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 f482a22..0c1e523 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) (
-- 
1.7.7



More information about the xorg-devel mailing list