diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-07 19:43:11 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-17 11:21:19 +1000 |
commit | 01241b4247a7ad0974d48412cc0d88e1a09a3c49 (patch) | |
tree | 3fd720e63810c091d4253fc6082153a38b7f30fd /Xi | |
parent | d230742ea820a21a3f1ed0c58b5e6d8680b2f2aa (diff) |
Xi: Add support for sourceid in the device classes.
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 9 | ||||
-rw-r--r-- | Xi/xiquerydevice.c | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 24fd11fc0..107ffce8c 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -199,6 +199,8 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master) if (device == master) return; + mk->sourceid = device->id; + for (i = 0; i < 8; i++) mk->modifierKeyCount[i] = dk->modifierKeyCount[i]; @@ -470,6 +472,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) FatalError("[Xi] no memory for trace.\n"); memcpy(to->focus->trace, from->focus->trace, from->focus->traceSize * sizeof(WindowPtr)); + to->focus->sourceid = from->id; } } else if (to->focus) { @@ -546,6 +549,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) memcpy(v->axes, from->valuator->axes, v->numAxes * sizeof(AxisInfo)); v->axisVal = (int*)(v->axes + from->valuator->numAxes); + v->sourceid = from->id; } else if (to->valuator && !from->valuator) { ClassesPtr classes; @@ -582,6 +586,8 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) sizeof(XkbAction)); } else xfree(to->button->xkb_acts); + + to->button->sourceid = from->id; } else if (to->button && !from->button) { ClassesPtr classes; @@ -606,6 +612,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) classes->proximity = NULL; } memcpy(to->proximity, from->proximity, sizeof(ProximityClassRec)); + to->proximity->sourceid = from->id; } else if (to->proximity) { ClassesPtr classes; @@ -630,6 +637,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) classes->absolute = NULL; } memcpy(to->absolute, from->absolute, sizeof(AbsoluteClassRec)); + to->absolute->sourceid = from->id; } else if (to->absolute) { ClassesPtr classes; @@ -1127,6 +1135,7 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev) proxc = (ProximityClassPtr) xalloc(sizeof(ProximityClassRec)); if (!proxc) return FALSE; + proxc->sourceid = dev->id; dev->proximity = proxc; return TRUE; } diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index 07ddfa1cf..b523f387a 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -231,6 +231,7 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info) info->type = ButtonClass; info->num_buttons = dev->button->numButtons; info->length = 2 + info->num_buttons; + info->sourceid = dev->button->sourceid; /** XXX: button labels */ @@ -245,6 +246,7 @@ SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info) int i; swaps(&info->type, n); swaps(&info->length, n); + swaps(&info->sourceid, n); for (i = 0, btn = (Atom*)&info[1]; i < info->num_buttons; i++, btn++) swaps(btn, n); @@ -266,6 +268,7 @@ ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info) info->type = KeyClass; info->num_keycodes = xkb->max_key_code - xkb->min_key_code + 1; info->length = 2 + info->num_keycodes; + info->sourceid = dev->key->sourceid; kc = (uint32_t*)&info[1]; for (i = xkb->min_key_code; i <= xkb->max_key_code; i++, kc++) @@ -282,6 +285,7 @@ SwapKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info) int i; swaps(&info->type, n); swaps(&info->length, n); + swaps(&info->sourceid, n); for (i = 0, key = (uint32_t*)&info[1]; i < info->num_keycodes; i++, key++) swapl(key, n); @@ -309,6 +313,7 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber) info->resolution = v->axes[axisnumber].resolution; info->number = axisnumber; info->mode = v->mode; /* Server doesn't have per-axis mode yet */ + info->sourceid = v->sourceid; return info->length * 4; } @@ -325,6 +330,7 @@ SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info) swapl(&info->max.integral, n); swapl(&info->max.frac, n); swaps(&info->number, n); + swaps(&info->sourceid, n); } int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment) |