summaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 74dd04d..9f8e003 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -113,6 +113,7 @@ static Atom prop_calibration;
static Atom prop_swap;
static Atom prop_axis_label;
static Atom prop_btn_label;
+static Atom prop_device;
/* All devices the evdev driver has allocated and knows about.
* MAXDEVICES is safe as null-terminated array, as two devices (VCP and VCK)
@@ -2200,6 +2201,23 @@ EvdevInitProperty(DeviceIntPtr dev)
EvdevPtr pEvdev = pInfo->private;
int rc;
BOOL invert[2];
+ char *device_node;
+
+ /* Device node property */
+ device_node = strdup(pEvdev->device);
+ prop_device = MakeAtom(XI_PROP_DEVICE_NODE,
+ strlen(XI_PROP_DEVICE_NODE), TRUE);
+ rc = XIChangeDeviceProperty(dev, prop_device, XA_STRING, 8,
+ PropModeReplace,
+ strlen(device_node), device_node,
+ FALSE);
+ free(device_node);
+
+ if (rc != Success)
+ return;
+
+ XISetDevicePropertyDeletable(dev, prop_device, FALSE);
+
if (pEvdev->flags & (EVDEV_RELATIVE_EVENTS | EVDEV_ABSOLUTE_EVENTS))
{
@@ -2278,7 +2296,9 @@ EvdevSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
InputInfoPtr pInfo = dev->public.devicePrivate;
EvdevPtr pEvdev = pInfo->private;
- if (atom == prop_invert)
+ if (atom == prop_device)
+ return BadValue;
+ else if (atom == prop_invert)
{
BOOL* data;
if (val->format != 8 || val->size != 2 || val->type != XA_INTEGER)