summaryrefslogtreecommitdiff
path: root/xserver/Xi/xiquerydevice.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2011-11-05 13:32:59 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2011-11-05 13:32:59 +0000
commitbf781c5ff285301ad70ffc5f4321b8906f71edd8 (patch)
tree3b770f4bf9a8cd11dd9f14e7f758991a73a52d78 /xserver/Xi/xiquerydevice.c
parente59d0622d3162f7b5a7420ef87dbebb200348c37 (diff)
Update to xserver 1.11.2
Diffstat (limited to 'xserver/Xi/xiquerydevice.c')
-rw-r--r--xserver/Xi/xiquerydevice.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/xserver/Xi/xiquerydevice.c b/xserver/Xi/xiquerydevice.c
index cc7eca630..a768d499c 100644
--- a/xserver/Xi/xiquerydevice.c
+++ b/xserver/Xi/xiquerydevice.c
@@ -107,8 +107,10 @@ ProcXIQueryDevice(ClientPtr client)
}
info = calloc(1, len);
- if (!info)
+ if (!info) {
+ free(skip);
return BadAlloc;
+ }
memset(&rep, 0, sizeof(xXIQueryDeviceReply));
rep.repType = X_Reply;
@@ -152,7 +154,8 @@ ProcXIQueryDevice(ClientPtr client)
}
}
}
- len = rep.length*4;
+
+ len = rep.length * 4;
WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep);
WriteToClient(client, len, ptr);
free(ptr);
@@ -349,7 +352,7 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber,
info->value.frac = (int)(v->axisVal[axisnumber] * (1 << 16) * (1 << 16));
info->resolution = v->axes[axisnumber].resolution;
info->number = axisnumber;
- info->mode = v->mode; /* Server doesn't have per-axis mode yet */
+ info->mode = valuator_get_mode(dev, axisnumber);
info->sourceid = v->sourceid;
if (!reportState)
@@ -375,7 +378,7 @@ SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info)
int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment)
{
- DeviceIntPtr master = dev->u.master;
+ DeviceIntPtr master = GetMaster(dev, MASTER_ATTACHED);
int use;
if (IsMaster(dev))
@@ -383,7 +386,7 @@ int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment)
DeviceIntPtr paired = GetPairedDevice(dev);
use = IsPointerDevice(dev) ? XIMasterPointer : XIMasterKeyboard;
*attachment = (paired ? paired->id : 0);
- } else if (master)
+ } else if (!IsFloating(dev))
{
use = IsPointerDevice(master) ? XISlavePointer : XISlaveKeyboard;
*attachment = master->id;