dix: call SetFocusOut and LeaveWindow when disabling a device.

PointerWindows[x] would be set after removing a master pointer. Destroying
this window then crashed the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-07-30 16:36:56 +10:00
parent 97ed946cfc
commit d3e5629fac
3 changed files with 4 additions and 1 deletions

View File

@ -448,6 +448,8 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
}
OsReleaseSignals();
LeaveWindow(dev);
SetFocusOut(dev);
*prev = dev->next;
dev->next = inputInfo.off_devices;

View File

@ -166,7 +166,7 @@ EnterWindow(DeviceIntPtr dev, WindowPtr win, int mode)
/**
* Unset the presence flag for dev to mark that it is not in 'win' anymore.
*/
static void
void
LeaveWindow(DeviceIntPtr dev)
{
PointerWindows[dev->id] = NULL;

View File

@ -76,6 +76,7 @@ extern void EnterWindow(DeviceIntPtr dev,
WindowPtr win,
int mode);
extern void LeaveWindow(DeviceIntPtr dev);
extern void CoreFocusEvent(DeviceIntPtr kbd,
int type,