diff options
-rw-r--r-- | Xi/exevents.c | 9 | ||||
-rw-r--r-- | Xi/xiquerydevice.c | 6 | ||||
-rw-r--r-- | dix/devices.c | 5 | ||||
-rw-r--r-- | include/inputstr.h | 6 | ||||
-rw-r--r-- | xkb/xkbInit.c | 1 |
5 files changed, 27 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) diff --git a/dix/devices.c b/dix/devices.c index 2b0358875..a5b111c75 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1143,6 +1143,7 @@ InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, if (!butc) return FALSE; butc->numButtons = numButtons; + butc->sourceid = dev->id; for (i = 1; i <= numButtons; i++) butc->map[i] = map[i]; dev->button = butc; @@ -1173,6 +1174,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, if (!valc) return FALSE; + valc->sourceid = dev->id; valc->motion = NULL; valc->first_motion = 0; valc->last_motion = 0; @@ -1300,6 +1302,8 @@ InitAbsoluteClassDeviceStruct(DeviceIntPtr dev) abs->following = 0; abs->screen = 0; + abs->sourceid = dev->id; + dev->absolute = abs; return TRUE; @@ -1319,6 +1323,7 @@ InitFocusClassDeviceStruct(DeviceIntPtr dev) focc->trace = (WindowPtr *)NULL; focc->traceSize = 0; focc->traceGood = 0; + focc->sourceid = dev->id; dev->focus = focc; return TRUE; } diff --git a/include/inputstr.h b/include/inputstr.h index ffeedb1fa..d7aedac3d 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -202,6 +202,7 @@ typedef struct _GrabRec { } GrabRec; typedef struct _KeyClassRec { + int sourceid; CARD8 down[DOWN_LENGTH]; CARD8 postdown[DOWN_LENGTH]; int modifierKeyCount[8]; @@ -224,6 +225,7 @@ typedef struct _ValuatorAccelerationRec { } ValuatorAccelerationRec, *ValuatorAccelerationPtr; typedef struct _ValuatorClassRec { + int sourceid; int numMotionEvents; int first_motion; int last_motion; @@ -239,6 +241,7 @@ typedef struct _ValuatorClassRec { } ValuatorClassRec, *ValuatorClassPtr; typedef struct _ButtonClassRec { + int sourceid; CARD8 numButtons; CARD8 buttonsDown; /* number of buttons currently down This counts logical buttons, not @@ -254,6 +257,7 @@ typedef struct _ButtonClassRec { } ButtonClassRec, *ButtonClassPtr; typedef struct _FocusClassRec { + int sourceid; WindowPtr win; /* May be set to a int constant (e.g. PointerRootWin)! */ int revert; TimeStamp time; @@ -263,10 +267,12 @@ typedef struct _FocusClassRec { } FocusClassRec, *FocusClassPtr; typedef struct _ProximityClassRec { + int sourceid; char pad; } ProximityClassRec, *ProximityClassPtr; typedef struct _AbsoluteClassRec { + int sourceid; /* Calibration. */ int min_x; int max_x; diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index e707f7ad3..86a7a115b 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -522,6 +522,7 @@ InitKeyboardDeviceStruct(DeviceIntPtr dev, XkbRMLVOSet *rmlvo, ErrorF("XKB: Failed to allocate key class\n"); return False; } + dev->key->sourceid = dev->id; dev->kbdfeed = xcalloc(1, sizeof(*dev->kbdfeed)); if (!dev->kbdfeed) { |