summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-01-25 11:47:32 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-02-08 14:12:56 +1000
commit3e4be4033aed78b2bb3a18d51f0963989efd1af3 (patch)
tree6c57d225c9b46cc23760109fc1ac7655282ab17f
parent0d5bb882600ee7734af034fbea935a79d21d1e70 (diff)
dix: when shutting down slave devices, shut down xtest devices last
XTest devices are the first ones in the list, being initialised together with the master devices. If we disable the devices in-order and a device has a button down when being disabled, the XTest device is checked for a required button release (xkbAccessX.c's ProcessPointerEvent). This fails if the device is already NULL. Instead of putting the check there, disable the devices in the reverse order they are initialised. Disable physical slaves first, then xtest devices, then the master devices. Testcase: shut down server with a button still held down on a physical device Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
-rw-r--r--dix/devices.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 3c7d480c6..172fc0460 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -516,6 +516,12 @@ DisableAllDevices(void)
{
DeviceIntPtr dev, tmp;
+ /* Disable slave devices first, excluding XTest devices */
+ nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
+ if (!IsXTestDevice(dev, NULL) && !IsMaster(dev))
+ DisableDevice(dev, FALSE);
+ }
+ /* Disable XTest devices */
nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
if (!IsMaster(dev))
DisableDevice(dev, FALSE);