dix: ensure Activate/DeactivateGrab has a valid value.

Xephyr doesn't manually set Activate/DeactivateGrab for new devices,
resulting in a NULL-pointer dereference later when a grab is activated.
Avoid the segfault by ensuring that the pointer is always valid.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-05-11 12:51:40 +10:00
parent e3f296d91d
commit fdce58ca82

View File

@ -226,6 +226,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
/* device grab defaults */
dev->deviceGrab.grabTime = currentTime;
dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
dev->coreEvents = TRUE;