summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-05-14 16:34:55 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-14 16:34:55 +1000
commit68da471cd7ad3b5d76bfc1207083f892b15dd34a (patch)
tree12c288fb40c1d6eff10f7ecd201809b35f715ddc /src
parent3017a5124fe98eb0d1f0e4d0bdce35df06ea751b (diff)
Update XIQueryPointer to include full modifier state.
Diffstat (limited to 'src')
-rw-r--r--src/XQueryDvPtr.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/XQueryDvPtr.c b/src/XQueryDvPtr.c
index 9d51db0..c0f9b2f 100644
--- a/src/XQueryDvPtr.c
+++ b/src/XQueryDvPtr.c
@@ -50,7 +50,9 @@ XIQueryPointer(Display *dpy,
int *root_y,
int *win_x,
int *win_y,
- unsigned int *mask)
+ XIButtonState *buttons,
+ XIModifierState *mods,
+ XIGroupState *group)
{
xXIQueryPointerReq *req;
xXIQueryPointerReply rep;
@@ -79,7 +81,19 @@ XIQueryPointer(Display *dpy,
*root_y = FP1616toDBL(cvtINT16toInt(rep.root_y));
*win_x = FP1616toDBL(cvtINT16toInt(rep.win_x));
*win_y = FP1616toDBL(cvtINT16toInt(rep.win_y));
- *mask = rep.mask;
+
+ mods->base = rep.mods.base_mods;
+ mods->latched = rep.mods.latched_mods;
+ mods->locked = rep.mods.locked_mods;
+ group->base = rep.group.base_group;
+ group->latched = rep.group.latched_group;
+ group->locked = rep.group.locked_group;
+
+ buttons->mask_len = rep.buttons_len * 4;
+ buttons->mask = malloc(buttons->mask_len);
+ if (buttons->mask)
+ memcpy(buttons->mask, (char*)(&rep + 1), buttons->mask_len);
+
UnlockDisplay(dpy);
SyncHandle();
return rep.same_screen;