diff --git a/dix/events.c b/dix/events.c index 1aadd57ee..3fae52df0 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3997,7 +3997,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev, rc = EventToXI2(event, &xi2); if (rc == Success) { - int evtype = ((xGenericEvent*)xi2)->evtype; + int evtype = xi2_get_type(xi2); mask = grab->xi2mask[XIAllDevices][evtype/8] | grab->xi2mask[XIAllMasterDevices][evtype/8] | grab->xi2mask[thisDev->id][evtype/8];