diff options
author | Daniel Stone <daniel@fooishbar.org> | 2006-10-23 02:48:30 +0300 |
---|---|---|
committer | Daniel Stone <daniels@endtroducing.fooishbar.org> | 2006-10-23 02:48:30 +0300 |
commit | eec182259112fba240751f974f7e5ca09fce8b9d (patch) | |
tree | e6f78699664a10a7433a3c36c3dcad84fa715137 /dix/getevents.c | |
parent | bc701a14292da5abfb601e3a040651a74f46df8f (diff) |
dix/getevents: move SyntheticMotion to getevents.c
Mostly, this is just a cheesy hack to ensure that getevents.o gets
included when linking. Sigh.
Diffstat (limited to 'dix/getevents.c')
-rw-r--r-- | dix/getevents.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index 03fe5fe4e..ca199c63b 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -51,6 +51,11 @@ extern Bool XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies); #include "xace.h" #endif +#ifdef PANORAMIX +#include "panoramiX.h" +#include "panoramiXsrv.h" +#endif + #include <X11/extensions/XIproto.h> #include "exglobals.h" #include "exevents.h" @@ -546,3 +551,32 @@ SwitchCorePointer(DeviceIntPtr pDev) if (inputInfo.pointer->devPrivates[CoreDevicePrivatesIndex].ptr != pDev) inputInfo.pointer->devPrivates[CoreDevicePrivatesIndex].ptr = pDev; } + + +/** + * Synthesize a single motion event for the core pointer. + * + * Used in cursor functions, e.g. when cursor confinement changes, and we need + * to shift the pointer to get it inside the new bounds. + */ +void +PostSyntheticMotion(int x, int y, int screenNum, unsigned long time) +{ + xEvent xE = { 0, }; + +#ifdef PANORAMIX + /* Translate back to the sprite screen since processInputProc + will translate from sprite screen to screen 0 upon reentry + to the DIX layer. */ + if (!noPanoramiXExtension) { + x += panoramiXdataPtr[0].x - panoramiXdataPtr[screenNum].x; + y += panoramiXdataPtr[0].y - panoramiXdataPtr[screenNum].y; + } +#endif + + xE.u.u.type = MotionNotify; + xE.u.keyButtonPointer.rootX = x; + xE.u.keyButtonPointer.rootY = y; + + (*inputInfo.pointer->public.processInputProc)(&xE, inputInfo.pointer, 1); +} |