[PATCHv2] evdev: add phys property (EVIOCGPHYS) as stable identifier
Peter Korsgaard
jacmet at sunsite.dk
Wed May 5 00:27:47 PDT 2010
>>>>> "Peter" == Peter Korsgaard <peter.korsgaard at barco.com> writes:
Peter> xinput ids are not guaranteed to be stable between reboots (or hotplugs)
Peter> /* All devices the evdev driver has allocated and knows about.
Peter> @@ -2463,6 +2464,17 @@ EvdevInitProperty(DeviceIntPtr dev)
Peter> EvdevPtr pEvdev = pInfo->private;
Peter> int rc;
Peter> BOOL invert[2];
Peter> + char phys[256];
Peter> +
Peter> + if (ioctl(pInfo->fd, EVIOCGPHYS(sizeof(phys) - 1), phys) >= 0)
Peter> + {
Peter> + prop_phys = MakeAtom(EVDEV_PROP_PHYSICAL,
Peter> + strlen(EVDEV_PROP_PHYSICAL), TRUE);
Peter> + rc = XIChangeDeviceProperty(dev, prop_phys, XA_STRING, 8,
Peter> + PropModeReplace, strlen(phys), phys, FALSE);
Peter> + if (rc != Success)
Peter> + return;
Peter> + }
Ups, somehow the XISetDevicePropertyDeletable() call disappeared - Will
resend.
--
Bye, Peter Korsgaard
More information about the xorg-devel
mailing list