* src/xterm.c (handle_one_xevent): Avoid disabling devices if we
notice it has been disabled while handling XISlaveDetached or
XISlaveAttached.
if (info)
{
- if (device && info->enabled)
+ if (device)
{
device->use = info->use;
device->attachment = info->attachment;
}
- else if (device)
- disabled[n_disabled++] = hev->info[i].deviceid;
+
+ /* device could have been disabled by now.
+ But instead of removing it immediately,
+ wait for XIDeviceDisabled, or internal
+ state could be left inconsistent. */
XIFreeDeviceInfo (info);
}