aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winmouse.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-07-12 18:20:04 +0000
committermarha <marha@users.sourceforge.net>2009-07-12 18:20:04 +0000
commitda8fe31a7ba4acf109097d5696ad0145b991cdfd (patch)
tree1c74d6f075702a73e557872f2a6f020ea4eb5432 /xorg-server/hw/xwin/winmouse.c
parent6590f805a12779909cb8504c230fa367148fe38c (diff)
parent529dcfd0858d75cb3c87c73cb0f81dd20bbb9230 (diff)
downloadvcxsrv-da8fe31a7ba4acf109097d5696ad0145b991cdfd.tar.gz
vcxsrv-da8fe31a7ba4acf109097d5696ad0145b991cdfd.tar.bz2
vcxsrv-da8fe31a7ba4acf109097d5696ad0145b991cdfd.zip
Changes for VC compilation
Diffstat (limited to 'xorg-server/hw/xwin/winmouse.c')
-rw-r--r--xorg-server/hw/xwin/winmouse.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/xorg-server/hw/xwin/winmouse.c b/xorg-server/hw/xwin/winmouse.c
index 1507dd34f..d25a66524 100644
--- a/xorg-server/hw/xwin/winmouse.c
+++ b/xorg-server/hw/xwin/winmouse.c
@@ -36,7 +36,7 @@
#endif
#include "win.h"
-#if defined(XFree86Server) && defined(XINPUT)
+#ifdef XINPUT
#include "inputstr.h"
/* Peek the internal button mapping */
@@ -106,7 +106,7 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
2);
free(map);
-#if defined(XFree86Server) && defined(XINPUT)
+#ifdef XINPUT
g_winMouseButtonMap = pDeviceInt->button->map;
#endif
break;
@@ -116,7 +116,7 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
break;
case DEVICE_CLOSE:
-#if defined(XFree86Server) && defined(XINPUT)
+#ifdef XINPUT
g_winMouseButtonMap = NULL;
#endif
case DEVICE_OFF:
@@ -221,11 +221,12 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
void
winMouseButtonsSendEvent (int iEventType, int iButton)
{
+ DeviceIntPtr pDev;
xEvent xCurrentEvent;
/* Load an xEvent and enqueue the event */
xCurrentEvent.u.u.type = iEventType;
-#if defined(XFree86Server) && defined(XINPUT)
+#ifdef XINPUT
if (g_winMouseButtonMap)
xCurrentEvent.u.u.detail = g_winMouseButtonMap[iButton];
else
@@ -233,7 +234,16 @@ winMouseButtonsSendEvent (int iEventType, int iButton)
xCurrentEvent.u.u.detail = iButton;
xCurrentEvent.u.keyButtonPointer.time
= g_c32LastInputEventTime = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
+
+#if CYGDEBUG
+ ErrorF("winMouseButtonsSendEvent: xCurrentEvent.u.u.type: %d, xCurrentEvent.u.u.detail: %d\n",
+ xCurrentEvent.u.u.type, xCurrentEvent.u.u.detail);
+#endif
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ if ((pDev->coreEvents && pDev != inputInfo.pointer) && pDev->button)
+ {
+ mieqEnqueue (pDev, &xCurrentEvent);
+ }
}
@@ -339,3 +349,25 @@ winMouseButtonsHandle (ScreenPtr pScreen,
return 0;
}
+
+/**
+ * Enqueue a motion event.
+ */
+void winEnqueueMotion(int x, int y)
+{
+ int i, nevents;
+ int valuators[2];
+
+ xEvent *events = (xEvent *)malloc(sizeof(xEvent) * GetMaximumEventsNum());
+
+ valuators[0] = x;
+ valuators[1] = y;
+ nevents = GetPointerEvents(events, inputInfo.pointer, MotionNotify, 0,
+ POINTER_ABSOLUTE, 0, 2, valuators);
+
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(inputInfo.pointer, events + i);
+
+ xfree(events);
+}
+// XXX: miPointerMove does exactly this, but is static :-( (and uses a static buffer)