dix/getevents: move SyntheticMotion to getevents.c
Mostly, this is just a cheesy hack to ensure that getevents.o gets included when linking. Sigh.
This commit is contained in:
parent
bc701a1429
commit
eec1822591
33
dix/events.c
33
dix/events.c
|
@ -320,11 +320,16 @@ static CARD8 criticalEvents[32] =
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
|
|
||||||
static void ConfineToShape(RegionPtr shape, int *px, int *py);
|
static void ConfineToShape(RegionPtr shape, int *px, int *py);
|
||||||
static void SyntheticMotion(int x, int y);
|
static void PostSyntheticMotion(int x, int y, int screenNum, int time);
|
||||||
static void PostNewCursor(void);
|
static void PostNewCursor(void);
|
||||||
|
|
||||||
|
#define SyntheticMotion(x, y) \
|
||||||
|
PostSyntheticMotion(x, y, sprite.screen->myNum, \
|
||||||
|
syncEvents.playingEvents ? \
|
||||||
|
syncEvents.time.milliseconds : \
|
||||||
|
currentTime.milliseconds);
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
XineramaSetCursorPosition(
|
XineramaSetCursorPosition(
|
||||||
int x,
|
int x,
|
||||||
|
@ -667,30 +672,6 @@ SetCriticalEvent(int event)
|
||||||
criticalEvents[event >> 3] |= 1 << (event & 7);
|
criticalEvents[event >> 3] |= 1 << (event & 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
SyntheticMotion(int x, int y)
|
|
||||||
{
|
|
||||||
xEvent xE;
|
|
||||||
|
|
||||||
#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[sprite.screen->myNum].x;
|
|
||||||
y += panoramiXdataPtr[0].y - panoramiXdataPtr[sprite.screen->myNum].y;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
xE.u.keyButtonPointer.rootX = x;
|
|
||||||
xE.u.keyButtonPointer.rootY = y;
|
|
||||||
if (syncEvents.playingEvents)
|
|
||||||
xE.u.keyButtonPointer.time = syncEvents.time.milliseconds;
|
|
||||||
else
|
|
||||||
xE.u.keyButtonPointer.time = currentTime.milliseconds;
|
|
||||||
xE.u.u.type = MotionNotify;
|
|
||||||
(*inputInfo.pointer->public.processInputProc)(&xE, inputInfo.pointer, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef SHAPE
|
#ifdef SHAPE
|
||||||
static void
|
static void
|
||||||
ConfineToShape(RegionPtr shape, int *px, int *py)
|
ConfineToShape(RegionPtr shape, int *px, int *py)
|
||||||
|
|
|
@ -51,6 +51,11 @@ extern Bool XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies);
|
||||||
#include "xace.h"
|
#include "xace.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PANORAMIX
|
||||||
|
#include "panoramiX.h"
|
||||||
|
#include "panoramiXsrv.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
|
@ -546,3 +551,32 @@ SwitchCorePointer(DeviceIntPtr pDev)
|
||||||
if (inputInfo.pointer->devPrivates[CoreDevicePrivatesIndex].ptr != pDev)
|
if (inputInfo.pointer->devPrivates[CoreDevicePrivatesIndex].ptr != pDev)
|
||||||
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);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue