From fcf0c0b8f332cbde03c1a479376b7913197962eb Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 11 Jun 2009 13:23:40 +1000 Subject: [PATCH] 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 --- Xi/exevents.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index fbcf6e3a9..23d8ee899 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -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); }