Merge remote branch 'whot/for-keith'
This commit is contained in:
commit
ca9c2472d7
|
@ -1051,16 +1051,19 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* FIXME: I'm broken. Please fix me. Thanks */
|
|
||||||
if (DeviceEventCallback) {
|
if (DeviceEventCallback) {
|
||||||
DeviceEventInfoRec eventinfo;
|
DeviceEventInfoRec eventinfo;
|
||||||
|
SpritePtr pSprite = device->spriteInfo->sprite;
|
||||||
|
|
||||||
eventinfo.events = (xEventPtr) xE;
|
/* see comment in EnqueueEvents regarding the next three lines */
|
||||||
eventinfo.count = count;
|
if (ev->any.type == ET_Motion)
|
||||||
|
ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
|
||||||
|
|
||||||
|
eventinfo.device = device;
|
||||||
|
eventinfo.event = ev;
|
||||||
CallCallbacks(&DeviceEventCallback, (pointer) & eventinfo);
|
CallCallbacks(&DeviceEventCallback, (pointer) & eventinfo);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
grab = device->deviceGrab.grab;
|
grab = device->deviceGrab.grab;
|
||||||
|
|
||||||
switch(event->type)
|
switch(event->type)
|
||||||
|
|
15
dix/events.c
15
dix/events.c
|
@ -1131,11 +1131,10 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
event->type == ET_KeyRelease)
|
event->type == ET_KeyRelease)
|
||||||
AccessXCancelRepeatKey(device->key->xkbInfo, event->detail.key);
|
AccessXCancelRepeatKey(device->key->xkbInfo, event->detail.key);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* FIXME: I'm broken now. Please fix me. */
|
|
||||||
if (DeviceEventCallback)
|
if (DeviceEventCallback)
|
||||||
{
|
{
|
||||||
DeviceEventInfoRec eventinfo;
|
DeviceEventInfoRec eventinfo;
|
||||||
|
|
||||||
/* The RECORD spec says that the root window field of motion events
|
/* The RECORD spec says that the root window field of motion events
|
||||||
* must be valid. At this point, it hasn't been filled in yet, so
|
* must be valid. At this point, it hasn't been filled in yet, so
|
||||||
* we do it here. The long expression below is necessary to get
|
* we do it here. The long expression below is necessary to get
|
||||||
|
@ -1145,14 +1144,14 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
|
||||||
* the data that GetCurrentRootWindow relies on hasn't been
|
* the data that GetCurrentRootWindow relies on hasn't been
|
||||||
* updated yet.
|
* updated yet.
|
||||||
*/
|
*/
|
||||||
if (xE->u.u.type == DeviceMotionNotify)
|
if (ev->any.type == ET_Motion)
|
||||||
XE_KBPTR.root =
|
ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
|
||||||
WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
|
|
||||||
eventinfo.events = xE;
|
eventinfo.event = ev;
|
||||||
eventinfo.count = nevents;
|
eventinfo.device = device;
|
||||||
CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
|
CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (event->type == ET_Motion)
|
if (event->type == ET_Motion)
|
||||||
{
|
{
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
|
|
|
@ -576,8 +576,8 @@ typedef struct {
|
||||||
extern _X_EXPORT CallbackListPtr DeviceEventCallback;
|
extern _X_EXPORT CallbackListPtr DeviceEventCallback;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
xEventPtr events;
|
InternalEvent *event;
|
||||||
int count;
|
DeviceIntPtr device;
|
||||||
} DeviceEventInfoRec;
|
} DeviceEventInfoRec;
|
||||||
|
|
||||||
extern int XItoCoreType(int xi_type);
|
extern int XItoCoreType(int xi_type);
|
||||||
|
@ -585,7 +585,7 @@ extern Bool DevHasCursor(DeviceIntPtr pDev);
|
||||||
extern Bool _X_EXPORT IsPointerDevice( DeviceIntPtr dev);
|
extern Bool _X_EXPORT IsPointerDevice( DeviceIntPtr dev);
|
||||||
extern Bool _X_EXPORT IsKeyboardDevice(DeviceIntPtr dev);
|
extern Bool _X_EXPORT IsKeyboardDevice(DeviceIntPtr dev);
|
||||||
extern Bool IsPointerEvent(InternalEvent *event);
|
extern Bool IsPointerEvent(InternalEvent *event);
|
||||||
extern Bool IsMaster(DeviceIntPtr dev);
|
extern _X_EXPORT Bool IsMaster(DeviceIntPtr dev);
|
||||||
|
|
||||||
extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
|
extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
|
||||||
extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what);
|
extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what);
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
|
|
||||||
#define FP1616(integral, frac) ((integral) * (1 << 16) + (frac) * (1 << 16))
|
#define FP1616(integral, frac) ((integral) * (1 << 16) + (frac) * (1 << 16))
|
||||||
|
|
||||||
_X_INTERNAL int EventToCore(InternalEvent *event, xEvent *core);
|
_X_EXPORT int EventToCore(InternalEvent *event, xEvent *core);
|
||||||
_X_INTERNAL int EventToXI(InternalEvent *ev, xEvent **xi, int *count);
|
_X_EXPORT int EventToXI(InternalEvent *ev, xEvent **xi, int *count);
|
||||||
_X_INTERNAL int EventToXI2(InternalEvent *ev, xEvent **xi);
|
_X_EXPORT int EventToXI2(InternalEvent *ev, xEvent **xi);
|
||||||
_X_INTERNAL int GetCoreType(InternalEvent* ev);
|
_X_INTERNAL int GetCoreType(InternalEvent* ev);
|
||||||
_X_INTERNAL int GetXIType(InternalEvent* ev);
|
_X_INTERNAL int GetXIType(InternalEvent* ev);
|
||||||
_X_INTERNAL int GetXI2Type(InternalEvent* ev);
|
_X_INTERNAL int GetXI2Type(InternalEvent* ev);
|
||||||
|
|
123
record/record.c
123
record/record.c
|
@ -42,6 +42,8 @@ and Jim Haggerty of Metheus.
|
||||||
#include "set.h"
|
#include "set.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
|
#include "eventconvert.h"
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -139,7 +141,8 @@ static int RecordDeleteContext(
|
||||||
XID /*id*/
|
XID /*id*/
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void RecordExtensionInit(void);
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
/* client private stuff */
|
/* client private stuff */
|
||||||
|
@ -727,6 +730,59 @@ RecordADeliveredEventOrError(CallbackListPtr *pcbl, pointer nulldata, pointer ca
|
||||||
} /* RecordADeliveredEventOrError */
|
} /* 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
|
/* RecordADeviceEvent
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
|
@ -756,55 +812,24 @@ RecordADeviceEvent(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
|
||||||
{
|
{
|
||||||
if (pRCAP->pDeviceEventSet)
|
if (pRCAP->pDeviceEventSet)
|
||||||
{
|
{
|
||||||
int ev; /* event index */
|
int count;
|
||||||
xEvent *pev = pei->events;
|
xEvent *xi_events = NULL;
|
||||||
for (ev = 0; ev < pei->count; ev++, pev++)
|
|
||||||
|
/* TODO check return values */
|
||||||
|
if (IsMaster(pei->device))
|
||||||
{
|
{
|
||||||
if (RecordIsMemberOfSet(pRCAP->pDeviceEventSet,
|
xEvent xE;
|
||||||
pev->u.u.type & 0177))
|
EventToCore(pei->event, &xE);
|
||||||
{
|
RecordSendProtocolEvents(pRCAP, pContext, &xE, 1);
|
||||||
xEvent swappedEvent;
|
}
|
||||||
xEvent *pEvToRecord = pev;
|
|
||||||
#ifdef PANORAMIX
|
|
||||||
xEvent shiftedEvent;
|
|
||||||
|
|
||||||
if (!noPanoramiXExtension &&
|
EventToXI(pei->event, &xi_events, &count);
|
||||||
(pev->u.u.type == MotionNotify ||
|
RecordSendProtocolEvents(pRCAP, pContext, xi_events, count);
|
||||||
pev->u.u.type == ButtonPress ||
|
xfree(xi_events);
|
||||||
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 */
|
|
||||||
} /* end this RCAP selects device events */
|
} /* end this RCAP selects device events */
|
||||||
} /* end for each RCAP on this context */
|
} /* end for each RCAP on this context */
|
||||||
} /* end for each enabled context */
|
} /* end for each enabled context */
|
||||||
} /* RecordADeviceEvent */
|
}
|
||||||
|
|
||||||
|
|
||||||
/* RecordFlushAllContexts
|
/* RecordFlushAllContexts
|
||||||
|
@ -2866,13 +2891,6 @@ RecordCloseDown(ExtensionEntry *extEntry)
|
||||||
void
|
void
|
||||||
RecordExtensionInit(void)
|
RecordExtensionInit(void)
|
||||||
{
|
{
|
||||||
/* FIXME Record is currently broken. Dont initialize it so that clients
|
|
||||||
* that require it can bail out correctly rather than waiting for stuff
|
|
||||||
* that'll never happen */
|
|
||||||
ErrorF("record: RECORD extension enabled at configure time.\n");
|
|
||||||
ErrorF("record: This extension is known to be broken, disabling extension now..\n");
|
|
||||||
ErrorF("record: http://bugs.freedesktop.org/show_bug.cgi?id=20500\n");
|
|
||||||
#if 0
|
|
||||||
ExtensionEntry *extentry;
|
ExtensionEntry *extentry;
|
||||||
|
|
||||||
RTContext = CreateNewResourceType(RecordDeleteContext, "RecordContext");
|
RTContext = CreateNewResourceType(RecordDeleteContext, "RecordContext");
|
||||||
|
@ -2895,6 +2913,5 @@ RecordExtensionInit(void)
|
||||||
}
|
}
|
||||||
RecordErrorBase = extentry->errorBase;
|
RecordErrorBase = extentry->errorBase;
|
||||||
|
|
||||||
#endif
|
|
||||||
} /* RecordExtensionInit */
|
} /* RecordExtensionInit */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue