summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dix/devices.c1
-rw-r--r--dix/events.c8
2 files changed, 2 insertions, 7 deletions
diff --git a/dix/devices.c b/dix/devices.c
index e448eab62..9ca8fe055 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -275,6 +275,7 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
dev->deviceGrab.activeGrab = AllocGrab();
+ dev->deviceGrab.sync.event = calloc(1, sizeof(DeviceEvent));
XkbSetExtension(dev, ProcessKeyboardEvent);
diff --git a/dix/events.c b/dix/events.c
index db86f5167..086f438fd 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3717,12 +3717,8 @@ ActivatePassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event)
}
if (grabinfo->sync.state == FROZEN_NO_EVENT)
- {
- if (!grabinfo->sync.event)
- grabinfo->sync.event = calloc(1, sizeof(DeviceEvent));
- *grabinfo->sync.event = event->device_event;
grabinfo->sync.state = FROZEN_WITH_EVENT;
- }
+ *grabinfo->sync.event = event->device_event;
free(xE);
return TRUE;
@@ -4310,8 +4306,6 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
case FREEZE_NEXT_EVENT:
grabinfo->sync.state = FROZEN_WITH_EVENT;
FreezeThaw(thisDev, TRUE);
- if (!grabinfo->sync.event)
- grabinfo->sync.event = calloc(1, sizeof(InternalEvent));
*grabinfo->sync.event = event->device_event;
break;
}