diff options
author | marha <marha@users.sourceforge.net> | 2010-02-25 07:51:00 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-02-25 07:51:00 +0000 |
commit | dca37d126746d995167a31f58d3a395ae162f5d4 (patch) | |
tree | 6f5a0e00be9e5f70d6bc341d4abdb1f14c8f79a2 /xorg-server/record/record.c | |
parent | 23fda7c555e6c749b1d9727be5e5571a0559b9b3 (diff) | |
parent | 24bc15a386e37908396c3f6088f6fc98ceaa0f46 (diff) | |
download | vcxsrv-dca37d126746d995167a31f58d3a395ae162f5d4.tar.gz vcxsrv-dca37d126746d995167a31f58d3a395ae162f5d4.tar.bz2 vcxsrv-dca37d126746d995167a31f58d3a395ae162f5d4.zip |
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/record/record.c')
-rw-r--r-- | xorg-server/record/record.c | 115 |
1 files changed, 70 insertions, 45 deletions
diff --git a/xorg-server/record/record.c b/xorg-server/record/record.c index 0ec92e167..1a10c9edc 100644 --- a/xorg-server/record/record.c +++ b/xorg-server/record/record.c @@ -42,6 +42,8 @@ and Jim Haggerty of Metheus. #include "set.h" #include "swaprep.h" #include "inputstr.h" +#include "eventconvert.h" + #include <stdio.h> #include <assert.h> @@ -139,7 +141,8 @@ static int RecordDeleteContext( XID /*id*/ ); - +void RecordExtensionInit(void); + /***************************************************************************/ /* client private stuff */ @@ -727,6 +730,59 @@ RecordADeliveredEventOrError(CallbackListPtr *pcbl, pointer nulldata, pointer ca } /* RecordADeliveredEventOrError */ +static void +RecordSendProtocolEvents(RecordClientsAndProtocolPtr pRCAP, + RecordContextPtr pContext, + xEvent* pev, int count) +{ + int ev; /* event index */ + + for (ev = 0; ev < count; ev++, pev++) + { + if (RecordIsMemberOfSet(pRCAP->pDeviceEventSet, + pev->u.u.type & 0177)) + { + xEvent swappedEvent; + xEvent *pEvToRecord = pev; +#ifdef PANORAMIX + xEvent shiftedEvent; + + if (!noPanoramiXExtension && + (pev->u.u.type == MotionNotify || + pev->u.u.type == ButtonPress || + pev->u.u.type == ButtonRelease || + pev->u.u.type == KeyPress || + pev->u.u.type == KeyRelease)) { + int scr = XineramaGetCursorScreen(inputInfo.pointer); + memcpy(&shiftedEvent, pev, sizeof(xEvent)); + shiftedEvent.u.keyButtonPointer.rootX += + panoramiXdataPtr[scr].x - + panoramiXdataPtr[0].x; + shiftedEvent.u.keyButtonPointer.rootY += + panoramiXdataPtr[scr].y - + panoramiXdataPtr[0].y; + pEvToRecord = &shiftedEvent; + } +#endif /* PANORAMIX */ + + if (pContext->pRecordingClient->swapped) + { + (*EventSwapVector[pEvToRecord->u.u.type & 0177]) + (pEvToRecord, &swappedEvent); + pEvToRecord = &swappedEvent; + } + + RecordAProtocolElement(pContext, NULL, + XRecordFromServer, pEvToRecord, SIZEOF(xEvent), 0); + /* make sure device events get flushed in the absence + * of other client activity + */ + SetCriticalOutputPending(); + } + } /* end for each event */ + +} /* RecordADeviceEvent */ + /* RecordADeviceEvent * * Arguments: @@ -756,55 +812,24 @@ RecordADeviceEvent(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) { if (pRCAP->pDeviceEventSet) { - int ev; /* event index */ - xEvent *pev = pei->events; - for (ev = 0; ev < pei->count; ev++, pev++) - { - if (RecordIsMemberOfSet(pRCAP->pDeviceEventSet, - pev->u.u.type & 0177)) - { - xEvent swappedEvent; - xEvent *pEvToRecord = pev; -#ifdef PANORAMIX - xEvent shiftedEvent; - - if (!noPanoramiXExtension && - (pev->u.u.type == MotionNotify || - pev->u.u.type == ButtonPress || - pev->u.u.type == ButtonRelease || - pev->u.u.type == KeyPress || - pev->u.u.type == KeyRelease)) { - int scr = XineramaGetCursorScreen(inputInfo.pointer); - memcpy(&shiftedEvent, pev, sizeof(xEvent)); - shiftedEvent.u.keyButtonPointer.rootX += - panoramiXdataPtr[scr].x - - panoramiXdataPtr[0].x; - shiftedEvent.u.keyButtonPointer.rootY += - panoramiXdataPtr[scr].y - - panoramiXdataPtr[0].y; - pEvToRecord = &shiftedEvent; - } -#endif /* PANORAMIX */ + int count; + xEvent *xi_events = NULL; - if (pContext->pRecordingClient->swapped) - { - (*EventSwapVector[pEvToRecord->u.u.type & 0177]) - (pEvToRecord, &swappedEvent); - pEvToRecord = &swappedEvent; - } + /* TODO check return values */ + if (IsMaster(pei->device)) + { + xEvent xE; + EventToCore(pei->event, &xE); + RecordSendProtocolEvents(pRCAP, pContext, &xE, 1); + } - RecordAProtocolElement(pContext, NULL, - XRecordFromServer, pEvToRecord, SIZEOF(xEvent), 0); - /* make sure device events get flushed in the absence - * of other client activity - */ - SetCriticalOutputPending(); - } - } /* end for each event */ + EventToXI(pei->event, &xi_events, &count); + RecordSendProtocolEvents(pRCAP, pContext, xi_events, count); + xfree(xi_events); } /* end this RCAP selects device events */ } /* end for each RCAP on this context */ } /* end for each enabled context */ -} /* RecordADeviceEvent */ +} /* RecordFlushAllContexts |