dix: store subpixel precision and send it down the wire to the client.
For the valuator data, not yet for root x/y and event x/y. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
9212948461
commit
4318075140
|
@ -357,7 +357,7 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi)
|
|||
xXIDeviceEvent *xde;
|
||||
int i, btlen, vallen;
|
||||
char *ptr;
|
||||
int32_t *axisval;
|
||||
FP3232 *axisval;
|
||||
|
||||
/* FIXME: this should just send the buttons we have, not MAX_BUTTONs. Same
|
||||
* with MAX_VALUATORS below */
|
||||
|
@ -401,15 +401,15 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi)
|
|||
}
|
||||
|
||||
ptr += xde->buttons_len * 4;
|
||||
axisval = (int32_t*)(ptr + xde->valuators_len * 4);
|
||||
axisval = (FP3232*)(ptr + xde->valuators_len * 4);
|
||||
for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++)
|
||||
{
|
||||
if (BitIsOn(ev->valuators.mask, i))
|
||||
{
|
||||
SetBit(ptr, i);
|
||||
*axisval = ev->valuators.data[i];
|
||||
axisval->integral = ev->valuators.data[i];
|
||||
axisval->frac = ev->valuators.data_frac[i];
|
||||
axisval++;
|
||||
axisval++; /* FIXME: this should be the frac. part */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -451,9 +451,10 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi)
|
|||
{
|
||||
SetBit(ptr, i);
|
||||
axisval->integral = ev->valuators.data[i];
|
||||
axisval->frac = ev->valuators.data_frac[i];
|
||||
(axisval + nvals)->integral = ev->valuators.data_raw[i];
|
||||
(axisval + nvals)->frac = ev->valuators.data_raw_frac[i];
|
||||
axisval++;
|
||||
/* FIXME: frac part */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -174,10 +174,13 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, int first_valuator,
|
|||
SetBit(event->valuators.mask, i);
|
||||
if (dev->valuator->mode == Absolute)
|
||||
SetBit(event->valuators.mode, i);
|
||||
event->valuators.data_frac[first_valuator + i] =
|
||||
dev->last.remainder[first_valuator + i] * (1 << 16) * (1 << 16);
|
||||
}
|
||||
|
||||
memcpy(&event->valuators.data[first_valuator],
|
||||
valuators, num_valuators * sizeof(uint32_t));
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -93,6 +93,7 @@ typedef struct
|
|||
uint8_t mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
|
||||
uint8_t mode[(MAX_VALUATORS + 7)/8]; /**< Valuator mode (Abs or Rel)*/
|
||||
uint32_t data[MAX_VALUATORS]; /**< Valuator data */
|
||||
int32_t data_frac[MAX_VALUATORS]; /**< Fractional part for data */
|
||||
} valuators;
|
||||
struct {
|
||||
uint32_t base; /**< XKB base modifiers */
|
||||
|
@ -191,7 +192,9 @@ typedef struct
|
|||
struct {
|
||||
uint8_t mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
|
||||
int32_t data[MAX_VALUATORS]; /**< Valuator data */
|
||||
int32_t data_frac[MAX_VALUATORS]; /**< Fractional part for data */
|
||||
int32_t data_raw[MAX_VALUATORS]; /**< Valuator data as posted */
|
||||
int32_t data_raw_frac[MAX_VALUATORS];/**< Fractional part for data_raw */
|
||||
} valuators;
|
||||
} RawDeviceEvent;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user