summaryrefslogtreecommitdiff
path: root/hw/xwin/winmouse.c
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2008-11-02 18:27:13 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2008-12-17 13:37:38 +0000
commit35d76028304f910edeaf642376df71b8134ec02c (patch)
tree565aa1fcf45da8d8f13bd00d0ecce7ce4e10d85f /hw/xwin/winmouse.c
parent816e0d243df068bc06d328874b5655d4530fe16a (diff)
Cygwin/X: enqueue a pointer motion event on mouse movement
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Diffstat (limited to 'hw/xwin/winmouse.c')
-rw-r--r--hw/xwin/winmouse.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c
index 04a2ae10e..188126b3a 100644
--- a/hw/xwin/winmouse.c
+++ b/hw/xwin/winmouse.c
@@ -344,3 +344,29 @@ winMouseButtonsHandle (ScreenPtr pScreen,
return 0;
}
+
+/**
+ * Enqueue a motion event.
+ *
+ * XXX: miPointerMove does exactly this, but is static :-( (and uses a static buffer)
+ *
+ */
+void winEnqueueMotion(int x, int y)
+{
+ miPointerSetPosition(g_pwinPointer, &x, &y);
+ g_c32LastInputEventTime = GetTickCount();
+
+ int i, nevents;
+ int valuators[2];
+
+ EventListPtr events;
+ GetEventList(&events);
+
+ valuators[0] = x;
+ valuators[1] = y;
+ nevents = GetPointerEvents(events, g_pwinPointer, MotionNotify, 0,
+ POINTER_ABSOLUTE, 0, 2, valuators);
+
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(g_pwinPointer, events[i].event);
+}