diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-11-04 10:44:31 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-09 14:56:23 +1000 |
commit | b0e9e2e32616d09c30a02b9d0ae9db0b13e150d1 (patch) | |
tree | ed56b40166201c019ab02924fc8c0596f59a0f84 /dix/events.c | |
parent | 347f377f3b3f8c9d230d6309ec8ae92aa86d78b7 (diff) |
dix: add CopyGrab() function
Not really needed at this point, but will be once touch support is added.
Since grabs are now expected to be allocated/freed with AllocGrab and
FreeGrab, CopyGrab must increase the refcount and duplicate the modifier
masks. Until the callers are switched to use FreeGrab, this introduces
memleaks.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'dix/events.c')
-rw-r--r-- | dix/events.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dix/events.c b/dix/events.c index 3c21a964c..c1c296d22 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1509,7 +1509,7 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab, grabinfo->grabTime = time; if (grab->cursor) grab->cursor->refcnt++; - grabinfo->activeGrab = *grab; + CopyGrab(&grabinfo->activeGrab, grab); grabinfo->grab = &grabinfo->activeGrab; grabinfo->fromPassiveGrab = isPassive; grabinfo->implicitGrab = autoGrab & ImplicitGrabMask; @@ -1586,7 +1586,7 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool pass grabinfo->grabTime = syncEvents.time; else grabinfo->grabTime = time; - grabinfo->activeGrab = *grab; + CopyGrab(&grabinfo->activeGrab, grab); grabinfo->grab = &grabinfo->activeGrab; grabinfo->fromPassiveGrab = passive; grabinfo->implicitGrab = passive & ImplicitGrabMask; |