summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-07-30 16:36:56 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-08-03 10:11:48 +1000
commitd3e5629fac224d53a972df5e2a87db02534f9b17 (patch)
tree2d7215ae08a23b0c0867a6c0269aa2a97bb655e8 /dix
parent97ed946cfccec5979c47b5fabf1ad56cc7d33ef4 (diff)
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>
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c2
-rw-r--r--dix/enterleave.c2
-rw-r--r--dix/enterleave.h1
3 files changed, 4 insertions, 1 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 32fd4451a..53b7e2ccd 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -448,6 +448,8 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
}
OsReleaseSignals();
+ LeaveWindow(dev);
+ SetFocusOut(dev);
*prev = dev->next;
dev->next = inputInfo.off_devices;
diff --git a/dix/enterleave.c b/dix/enterleave.c
index 29b93499c..c08cc3100 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -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;
diff --git a/dix/enterleave.h b/dix/enterleave.h
index 4da4e02fb..471f4efaa 100644
--- a/dix/enterleave.h
+++ b/dix/enterleave.h
@@ -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,