summaryrefslogtreecommitdiff
path: root/dix/grabs.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/grabs.c')
-rw-r--r--dix/grabs.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/dix/grabs.c b/dix/grabs.c
index b254ddcf1..a03897af4 100644
--- a/dix/grabs.c
+++ b/dix/grabs.c
@@ -241,13 +241,11 @@ CreateGrab(int client, DeviceIntPtr device, DeviceIntPtr modDevice,
grab->detail.exact = keybut;
grab->detail.pMask = NULL;
grab->confineTo = confineTo;
- grab->cursor = cursor;
+ grab->cursor = RefCursor(cursor);
grab->next = NULL;
if (grabtype == XI2)
xi2mask_merge(grab->xi2mask, mask->xi2mask);
- if (cursor)
- cursor->refcnt++;
return grab;
}
@@ -274,9 +272,6 @@ CopyGrab(GrabPtr dst, const GrabPtr src)
Mask *details_mask = NULL;
XI2Mask *xi2mask;
- if (src->cursor)
- src->cursor->refcnt++;
-
if (src->modifiersDetail.pMask) {
int len = MasksPerDetailMask * sizeof(Mask);
@@ -314,6 +309,7 @@ CopyGrab(GrabPtr dst, const GrabPtr src)
dst->modifiersDetail.pMask = mdetails_mask;
dst->detail.pMask = details_mask;
dst->xi2mask = xi2mask;
+ dst->cursor = RefCursor(src->cursor);
xi2mask_merge(dst->xi2mask, src->xi2mask);