summaryrefslogtreecommitdiff
path: root/dix/events.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-04-23 15:52:18 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-05-10 14:32:37 +1000
commit925e35122ebad877395bcf13676e9dbeb254bdfa (patch)
tree872778817cfea50ac0050cd7f100340c6e464471 /dix/events.c
parent4980bcef9973ba1f90f53028f061669ee5d2661b (diff)
dix: AllocGrab can copy if an argument is passed in
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix/events.c')
-rw-r--r--dix/events.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/dix/events.c b/dix/events.c
index dc503118a..cd2d9397e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1492,8 +1492,7 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab,
if (grab->cursor)
grab->cursor->refcnt++;
BUG_WARN(grabinfo->grab != NULL);
- grabinfo->grab = AllocGrab();
- CopyGrab(grabinfo->grab, grab);
+ grabinfo->grab = AllocGrab(grab);
grabinfo->fromPassiveGrab = isPassive;
grabinfo->implicitGrab = autoGrab & ImplicitGrabMask;
PostNewCursor(mouse);
@@ -1596,8 +1595,7 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
else
grabinfo->grabTime = time;
BUG_WARN(grabinfo->grab != NULL);
- grabinfo->grab = AllocGrab();
- CopyGrab(grabinfo->grab, grab);
+ grabinfo->grab = AllocGrab(grab);
grabinfo->fromPassiveGrab = passive;
grabinfo->implicitGrab = passive & ImplicitGrabMask;
CheckGrabForSyncs(keybd, (Bool) grab->keyboardMode,
@@ -1991,7 +1989,7 @@ ActivateImplicitGrab(DeviceIntPtr dev, ClientPtr client, WindowPtr win,
else
return FALSE;
- tempGrab = AllocGrab();
+ tempGrab = AllocGrab(NULL);
if (!tempGrab)
return FALSE;
tempGrab->next = NULL;
@@ -3898,7 +3896,7 @@ CheckPassiveGrabsOnWindow(WindowPtr pWin,
if (!grab)
return NULL;
- tempGrab = AllocGrab();
+ tempGrab = AllocGrab(NULL);
/* Fill out the grab details, but leave the type for later before
* comparing */
@@ -5087,7 +5085,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
else {
GrabPtr tempGrab;
- tempGrab = AllocGrab();
+ tempGrab = AllocGrab(NULL);
tempGrab->next = NULL;
tempGrab->window = pWin;
@@ -5443,7 +5441,7 @@ ProcUngrabKey(ClientPtr client)
client->errorValue = stuff->modifiers;
return BadValue;
}
- tempGrab = AllocGrab();
+ tempGrab = AllocGrab(NULL);
if (!tempGrab)
return BadAlloc;
tempGrab->resource = client->clientAsMask;
@@ -5637,7 +5635,7 @@ ProcUngrabButton(ClientPtr client)
ptr = PickPointer(client);
- tempGrab = AllocGrab();
+ tempGrab = AllocGrab(NULL);
if (!tempGrab)
return BadAlloc;
tempGrab->resource = client->clientAsMask;