aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/eventconvert.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-10-05 17:44:57 +0200
committermarha <marha@users.sourceforge.net>2011-10-05 17:44:57 +0200
commit8af87a5b60e37ae84fdd759e2c1602be38be4905 (patch)
tree2e621c7fbdc4dfe9eb8d733af4cc232bc03643d4 /xorg-server/dix/eventconvert.c
parent8238de0fe0c28bd54b3e6cdd1fc94513cf21d3cc (diff)
parentf7025b4baa1ba35ee796785641f04eac5bedb0a6 (diff)
downloadvcxsrv-8af87a5b60e37ae84fdd759e2c1602be38be4905.tar.gz
vcxsrv-8af87a5b60e37ae84fdd759e2c1602be38be4905.tar.bz2
vcxsrv-8af87a5b60e37ae84fdd759e2c1602be38be4905.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/mapi/glapi/glapi.h mesalib/src/mesa/main/syncobj.h xorg-server/dix/events.c xorg-server/dix/getevents.c xorg-server/include/misc.h
Diffstat (limited to 'xorg-server/dix/eventconvert.c')
-rw-r--r--xorg-server/dix/eventconvert.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/xorg-server/dix/eventconvert.c b/xorg-server/dix/eventconvert.c
index dafe94207..47108fd70 100644
--- a/xorg-server/dix/eventconvert.c
+++ b/xorg-server/dix/eventconvert.c
@@ -605,6 +605,7 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi)
xde->root_x = FP1616(ev->root_x, ev->root_x_frac);
xde->root_y = FP1616(ev->root_y, ev->root_y_frac);
+ xde->flags = ev->flags;
if (ev->key_repeat)
xde->flags |= XIKeyRepeat;
@@ -632,8 +633,9 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi)
if (BitIsOn(ev->valuators.mask, i))
{
SetBit(ptr, i);
- axisval->integral = ev->valuators.data[i];
- axisval->frac = ev->valuators.data_frac[i];
+ axisval->integral = trunc(ev->valuators.data[i]);
+ axisval->frac = (ev->valuators.data[i] - axisval->integral) *
+ (1 << 16) * (1 << 16);
axisval++;
}
}
@@ -648,7 +650,7 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi)
int vallen, nvals;
int i, len = sizeof(xXIRawEvent);
char *ptr;
- FP3232 *axisval;
+ FP3232 *axisval, *axisval_raw;
nvals = count_bits(ev->valuators.mask, sizeof(ev->valuators.mask));
len += nvals * sizeof(FP3232) * 2; /* 8 byte per valuator, once
@@ -666,19 +668,25 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi)
raw->detail = ev->detail.button;
raw->deviceid = ev->deviceid;
raw->valuators_len = vallen;
+ raw->flags = ev->flags;
ptr = (char*)&raw[1];
axisval = (FP3232*)(ptr + raw->valuators_len * 4);
+ axisval_raw = axisval + nvals;
for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++)
{
if (BitIsOn(ev->valuators.mask, i))
{
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->integral = trunc(ev->valuators.data[i]);
+ axisval->frac = (ev->valuators.data[i] - axisval->integral) *
+ (1 << 16) * (1 << 16);
+ axisval_raw->integral = trunc(ev->valuators.data_raw[i]);
+ axisval_raw->frac =
+ (ev->valuators.data_raw[i] - axisval_raw->integral) *
+ (1 << 16) * (1 << 16);
axisval++;
+ axisval_raw++;
}
}