dix: check for grab type before checking XI2 mask

if the grab type isn't XI2, grab->xi2mask is random. That random data may
have the enter/leave mask set, leading to events sent to the client that the
client can't handler.

Source of these errors:
  _xgeWireToEvent: Unknown extension 131, this should never happen.

Simplest reproducer:
   Start Xephyr, press button inside window, move out. As the pointer leaves
   the Xephyr window, the errors appear.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Peter Hutterer 2013-08-16 15:30:59 +10:00
parent 16894df1ff
commit 82939e0239

View File

@ -4653,7 +4653,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
filter = GetEventFilter(mouse, (xEvent *) event);
if (grab) {
if (grab && grab->type == XI2) {
Mask mask;
mask = xi2mask_isset(grab->xi2mask, mouse, type);