diff options
author | Chase Douglas <chase.douglas@ubuntu.com> | 2010-11-09 11:59:06 -0500 |
---|---|---|
committer | Chase Douglas <chase.douglas@ubuntu.com> | 2010-11-09 12:06:49 -0500 |
commit | 5067987abc86b9367fda3338f30143365709cb5c (patch) | |
tree | 34d2f782bf7843986219708077f932e1529aba7b | |
parent | cf288e7b4701e43f0ec21dcd8b230322849bba5b (diff) |
Fix touch sprites
-rw-r--r-- | Xi/exevents.c | 2 | ||||
-rw-r--r-- | dix/devices.c | 17 | ||||
-rw-r--r-- | include/inputstr.h | 2 |
3 files changed, 16 insertions, 5 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index bed67f2be..b6ec42c03 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1007,7 +1007,7 @@ ProcessTouchEvent(DeviceEvent *ev, DeviceIntPtr device) * we need to build a window trace; in Relative, we just use the sprite. */ if (device->touch->mode == XIDirectTouch) { - sprite = device->touch->spriteInfo[touch]->sprite; + sprite = &device->touch->sprite[touch]; win = XYToWindow(sprite, ev->valuators.data[t->x_axis], ev->valuators.data[t->y_axis]); } diff --git a/dix/devices.c b/dix/devices.c index 80b6ba0c4..945798f1d 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1589,7 +1589,7 @@ InitTouchClassDeviceStruct(DeviceIntPtr device, unsigned int max_touches, touch = calloc(1, sizeof(TouchClassRec) + numAxes * sizeof(TouchAxisInfo) + - max_touches * sizeof(SpriteInfoRec) + + max_touches * sizeof(SpriteRec) + max_touches * sizeof(int *) + max_touches * numAxes * sizeof(int) + max_touches * sizeof(float *) + @@ -1598,8 +1598,8 @@ InitTouchClassDeviceStruct(DeviceIntPtr device, unsigned int max_touches, return FALSE; touch->axes = (TouchAxisInfoPtr)(touch + 1); - touch->spriteInfo = (SpriteInfoPtr *)(touch->axes + numAxes); - touch->last.valuators = (int **)(touch->spriteInfo + max_touches); + touch->sprite = (SpriteRec *)(touch->axes + numAxes); + touch->last.valuators = (int **)(touch->sprite + max_touches); valuators = (int *)(touch->last.valuators + max_touches); for (i = 0; i < max_touches; i++) @@ -1616,6 +1616,17 @@ InitTouchClassDeviceStruct(DeviceIntPtr device, unsigned int max_touches, remainder += numAxes; } + for (i = 0; i < max_touches; i++) + { + SpritePtr sprite = &touch->sprite[i]; + + sprite->spriteTrace = (WindowPtr *)calloc(1, 32*sizeof(WindowPtr)); + if (!sprite->spriteTrace) + FatalError("Failed to allocate touch spriteTrace"); + sprite->spriteTraceSize = 32; + sprite->spriteTrace[0] = screenInfo.screens[0]->root; + } + touch->sourceid = device->id; touch->numAxes = numAxes; touch->numTouches = max_touches; diff --git a/include/inputstr.h b/include/inputstr.h index ef0904d48..1ad4a2c6d 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -316,7 +316,7 @@ typedef struct _TouchClassRec { TouchAxisInfoPtr axes; unsigned short numAxes; unsigned short numTouches; - SpriteInfoPtr *spriteInfo; + SpriteRec *sprite; struct { int **valuators; float **remainder; |