Xi: XISetEventMask needs to clear the mask if len is 0

zero-length masks are supposed to clear the device's mask.
ProcXISelectEvents passes these masks through directly, so we need to clear
the bits here if such a mask is supplied.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-06-11 13:23:40 +10:00
parent 22b4ac44e4
commit fcf0c0b8f3

View File

@ -2167,7 +2167,10 @@ XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
others= wOtherInputMasks(win)->inputClients;
}
memcpy(others->xi2mask[dev->id], mask, len);
if (!len)
memset(others->xi2mask[dev->id], 0, sizeof(others->xi2mask[dev->id]));
else
memcpy(others->xi2mask[dev->id], mask, len);
RecalculateDeviceDeliverableEvents(win);
}