summaryrefslogtreecommitdiff
path: root/Xi/xiquerypointer.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-08-21 12:12:05 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-08-24 10:08:09 +1000
commite4ea91a02d6fac9dad844150c5d2fbe7dc9629b1 (patch)
tree4bdb50d8ff9e735e38bdc13ed7733500aeb88ee5 /Xi/xiquerypointer.c
parent8e396f2b806496cdcac233cc731b0322735020c3 (diff)
Xi: allow XIQueryPointer requests for master pointers and floating slaves.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi/xiquerypointer.c')
-rw-r--r--Xi/xiquerypointer.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c
index 80e953dd8..81ba13d33 100644
--- a/Xi/xiquerypointer.c
+++ b/Xi/xiquerypointer.c
@@ -91,7 +91,8 @@ ProcXIQueryPointer(ClientPtr client)
return rc;
}
- if (pDev->valuator == NULL)
+ if (pDev->valuator == NULL || IsKeyboardDevice(pDev) ||
+ (!IsMaster(pDev) && pDev->u.master)) /* no attached devices */
{
client->errorValue = stuff->deviceid;
return BadDevice;
@@ -108,9 +109,14 @@ ProcXIQueryPointer(ClientPtr client)
if (pDev->valuator->motionHintWindow)
MaybeStopHint(pDev, client);
- kbd = GetPairedDevice(pDev);
+ if (IsMaster(pDev))
+ kbd = GetPairedDevice(pDev);
+ else
+ kbd = (pDev->key) ? pDev : NULL;
pSprite = pDev->spriteInfo->sprite;
+
+ memset(&rep, 0, sizeof(rep));
rep.repType = X_Reply;
rep.RepType = X_XIQueryPointer;
rep.length = 5;
@@ -120,14 +126,17 @@ ProcXIQueryPointer(ClientPtr client)
rep.root_y = FP1616(pSprite->hot.y, 0);
rep.child = None;
- state = &kbd->key->xkbInfo->prev_state;
- rep.mods.base_mods = state->base_mods;
- rep.mods.latched_mods = state->latched_mods;
- rep.mods.locked_mods = state->locked_mods;
-
- rep.group.base_group = state->base_group;
- rep.group.latched_group = state->latched_group;
- rep.group.locked_group = state->locked_group;
+ if (kbd)
+ {
+ state = &kbd->key->xkbInfo->prev_state;
+ rep.mods.base_mods = state->base_mods;
+ rep.mods.latched_mods = state->latched_mods;
+ rep.mods.locked_mods = state->locked_mods;
+
+ rep.group.base_group = state->base_group;
+ rep.group.latched_group = state->latched_group;
+ rep.group.locked_group = state->locked_group;
+ }
if (pDev->button)
{