Xext: purge XGE event masks.
The masks were originally designed to generically handle event masks for extensions. Since all that is in-server anyway, it's much better writing custom event masks for those extensions that need it and not providing a unified mechanism. XI2 needs more than the current implementation, which is already too complex for most other extensions. good riddance. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6fe4c28bf4
commit
445daa62e7
187
Xext/geext.c
187
Xext/geext.c
|
@ -58,7 +58,6 @@ static const int version_requests[] = {
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
static void SGEGenericEvent(xEvent* from, xEvent* to);
|
static void SGEGenericEvent(xEvent* from, xEvent* to);
|
||||||
static void GERecalculateWinMask(WindowPtr pWin);
|
|
||||||
|
|
||||||
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
|
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
|
||||||
|
|
||||||
|
@ -217,43 +216,6 @@ SGEGenericEvent(xEvent* from, xEvent* to)
|
||||||
GEExtensions[gefrom->extension & 0x7F].evswap(gefrom, geto);
|
GEExtensions[gefrom->extension & 0x7F].evswap(gefrom, geto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Resource callback, invoked when the client disconnects and the associated
|
|
||||||
* GE masks must be destroyed.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
GEClientGone(WindowPtr pWin, XID id)
|
|
||||||
{
|
|
||||||
GenericClientMasksPtr gclmask;
|
|
||||||
GenericMaskPtr gmask, prev = NULL;
|
|
||||||
|
|
||||||
if (!pWin || !pWin->optional)
|
|
||||||
return Success;
|
|
||||||
|
|
||||||
gclmask = pWin->optional->geMasks;
|
|
||||||
for (gmask = gclmask->geClients; gmask; gmask = gmask->next)
|
|
||||||
{
|
|
||||||
if (gmask->resource == id)
|
|
||||||
{
|
|
||||||
if (prev)
|
|
||||||
{
|
|
||||||
prev->next = gmask->next;
|
|
||||||
xfree(gmask);
|
|
||||||
} else {
|
|
||||||
gclmask->geClients = NULL;
|
|
||||||
CheckWindowOptionalNeed(pWin);
|
|
||||||
GERecalculateWinMask(pWin);
|
|
||||||
xfree(gmask);
|
|
||||||
}
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
prev = gmask;
|
|
||||||
}
|
|
||||||
|
|
||||||
FatalError("Client not a GE client");
|
|
||||||
return BadImplementation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Init extension, register at server.
|
/* Init extension, register at server.
|
||||||
* Since other extensions may rely on XGE (XInput does already), it is a good
|
* Since other extensions may rely on XGE (XInput does already), it is a good
|
||||||
* idea to init XGE first, before any other extension.
|
* idea to init XGE first, before any other extension.
|
||||||
|
@ -277,9 +239,6 @@ GEExtensionInit(void)
|
||||||
GEErrorBase = extEntry->errorBase;
|
GEErrorBase = extEntry->errorBase;
|
||||||
GEEventType = GEEventBase;
|
GEEventType = GEEventBase;
|
||||||
|
|
||||||
RT_GECLIENT = CreateNewResourceType((DeleteType)GEClientGone);
|
|
||||||
RegisterResourceName(RT_GECLIENT, "GECLIENT");
|
|
||||||
|
|
||||||
memset(GEExtensions, 0, sizeof(GEExtensions));
|
memset(GEExtensions, 0, sizeof(GEExtensions));
|
||||||
|
|
||||||
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
|
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
|
||||||
|
@ -326,149 +285,3 @@ GEInitEvent(xGenericEvent* ev, int extension)
|
||||||
ev->length = 0;
|
ev->length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Recalculates the summary mask for the window. */
|
|
||||||
static void
|
|
||||||
GERecalculateWinMask(WindowPtr pWin)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
GenericMaskPtr it;
|
|
||||||
GenericClientMasksPtr evmasks;
|
|
||||||
|
|
||||||
if (!pWin->optional)
|
|
||||||
return;
|
|
||||||
|
|
||||||
evmasks = pWin->optional->geMasks;
|
|
||||||
|
|
||||||
for (i = 0; i < MAXEXTENSIONS; i++)
|
|
||||||
{
|
|
||||||
evmasks->eventMasks[i] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
it = pWin->optional->geMasks->geClients;
|
|
||||||
while(it)
|
|
||||||
{
|
|
||||||
for (i = 0; i < MAXEXTENSIONS; i++)
|
|
||||||
{
|
|
||||||
evmasks->eventMasks[i] |= it->eventMask[i];
|
|
||||||
}
|
|
||||||
it = it->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set generic event mask for given window. */
|
|
||||||
void
|
|
||||||
GEWindowSetMask(ClientPtr pClient, DeviceIntPtr pDev,
|
|
||||||
WindowPtr pWin, int extension, Mask mask)
|
|
||||||
{
|
|
||||||
GenericMaskPtr cli;
|
|
||||||
|
|
||||||
extension = (extension & 0x7F);
|
|
||||||
|
|
||||||
if (extension > MAXEXTENSIONS)
|
|
||||||
{
|
|
||||||
ErrorF("Invalid extension number.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pWin->optional && !MakeWindowOptional(pWin))
|
|
||||||
{
|
|
||||||
ErrorF("GE: Could not make window optional.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mask)
|
|
||||||
{
|
|
||||||
GenericClientMasksPtr evmasks = pWin->optional->geMasks;
|
|
||||||
|
|
||||||
/* check for existing client */
|
|
||||||
cli = evmasks->geClients;
|
|
||||||
while(cli)
|
|
||||||
{
|
|
||||||
if (rClient(cli) == pClient && cli->dev == pDev)
|
|
||||||
break;
|
|
||||||
cli = cli->next;
|
|
||||||
}
|
|
||||||
if (!cli)
|
|
||||||
{
|
|
||||||
/* new client and/or new device */
|
|
||||||
cli = (GenericMaskPtr)xcalloc(1, sizeof(GenericMaskRec));
|
|
||||||
if (!cli)
|
|
||||||
{
|
|
||||||
ErrorF("GE: Insufficient memory to alloc client.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
cli->next = evmasks->geClients;
|
|
||||||
cli->resource = FakeClientID(pClient->index);
|
|
||||||
cli->dev = pDev;
|
|
||||||
evmasks->geClients = cli;
|
|
||||||
AddResource(cli->resource, RT_GECLIENT, (pointer)pWin);
|
|
||||||
}
|
|
||||||
cli->eventMask[extension] = mask;
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
/* remove client. */
|
|
||||||
cli = pWin->optional->geMasks->geClients;
|
|
||||||
if (rClient(cli) == pClient && cli->dev == pDev)
|
|
||||||
{
|
|
||||||
pWin->optional->geMasks->geClients = cli->next;
|
|
||||||
xfree(cli);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
GenericMaskPtr prev = cli;
|
|
||||||
cli = cli->next;
|
|
||||||
|
|
||||||
while(cli)
|
|
||||||
{
|
|
||||||
if (rClient(cli) == pClient && cli->dev == pDev)
|
|
||||||
{
|
|
||||||
prev->next = cli->next;
|
|
||||||
xfree(cli);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
prev = cli;
|
|
||||||
cli = cli->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!cli)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
GERecalculateWinMask(pWin);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return TRUE if the mask for the given device is set.
|
|
||||||
* @param pWin Window the event may be delivered to.
|
|
||||||
* @param pDev Device the device originating the event. May be NULL.
|
|
||||||
* @param extension Extension ID
|
|
||||||
* @param mask Event mask
|
|
||||||
*/
|
|
||||||
BOOL
|
|
||||||
GEDeviceMaskIsSet(WindowPtr pWin, DeviceIntPtr pDev,
|
|
||||||
int extension, Mask mask)
|
|
||||||
{
|
|
||||||
GenericMaskPtr gemask;
|
|
||||||
|
|
||||||
if (!pWin->optional || !pWin->optional->geMasks)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
extension &= 0x7F;
|
|
||||||
|
|
||||||
if (!pWin->optional->geMasks->eventMasks[extension] & mask)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
|
|
||||||
gemask = pWin->optional->geMasks->geClients;
|
|
||||||
|
|
||||||
while(gemask)
|
|
||||||
{
|
|
||||||
if ((!gemask->dev || gemask->dev == pDev) &&
|
|
||||||
(gemask->eventMask[extension] & mask))
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
gemask = gemask->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
21
Xext/geext.h
21
Xext/geext.h
|
@ -34,22 +34,6 @@ from the author.
|
||||||
#define _GEEXT_H_
|
#define _GEEXT_H_
|
||||||
#include <X11/extensions/geproto.h>
|
#include <X11/extensions/geproto.h>
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This struct is used both in the window and by grabs to determine the event
|
|
||||||
* mask for a client.
|
|
||||||
* A window will have a linked list of these structs, with one entry per
|
|
||||||
* client per device, null-terminated.
|
|
||||||
* A grab has only one instance of this struct.
|
|
||||||
*/
|
|
||||||
typedef struct _GenericMaskRec {
|
|
||||||
struct _GenericMaskRec* next;
|
|
||||||
XID resource; /* id for the resource manager */
|
|
||||||
DeviceIntPtr dev;
|
|
||||||
Mask eventMask[MAXEXTENSIONS]; /* one mask per extension */
|
|
||||||
} GenericMaskRec, *GenericMaskPtr;
|
|
||||||
|
|
||||||
|
|
||||||
/* Struct to keep information about registered extensions
|
/* Struct to keep information about registered extensions
|
||||||
*
|
*
|
||||||
* evswap ... use to swap event fields for different byte ordered clients.
|
* evswap ... use to swap event fields for different byte ordered clients.
|
||||||
|
@ -96,9 +80,6 @@ extern _X_EXPORT GEExtension GEExtensions[MAXEXTENSIONS];
|
||||||
|
|
||||||
|
|
||||||
/* Interface for other extensions */
|
/* Interface for other extensions */
|
||||||
extern _X_EXPORT void GEWindowSetMask(ClientPtr pClient, DeviceIntPtr pDev,
|
|
||||||
WindowPtr pWin, int extension, Mask mask);
|
|
||||||
|
|
||||||
extern _X_EXPORT void GERegisterExtension(
|
extern _X_EXPORT void GERegisterExtension(
|
||||||
int extension,
|
int extension,
|
||||||
void (*ev_dispatch)(xGenericEvent* from, xGenericEvent* to),
|
void (*ev_dispatch)(xGenericEvent* from, xGenericEvent* to),
|
||||||
|
@ -107,8 +88,6 @@ extern _X_EXPORT void GERegisterExtension(
|
||||||
);
|
);
|
||||||
|
|
||||||
extern _X_EXPORT void GEInitEvent(xGenericEvent* ev, int extension);
|
extern _X_EXPORT void GEInitEvent(xGenericEvent* ev, int extension);
|
||||||
extern _X_EXPORT BOOL GEDeviceMaskIsSet(WindowPtr pWin, DeviceIntPtr pDev,
|
|
||||||
int extension, Mask mask);
|
|
||||||
|
|
||||||
extern _X_EXPORT void GEExtensionInit(void);
|
extern _X_EXPORT void GEExtensionInit(void);
|
||||||
|
|
||||||
|
|
|
@ -1787,7 +1787,6 @@ CheckDeviceGrabAndHintWindow(WindowPtr pWin, int type,
|
||||||
tempGrab.pointerMode = GrabModeAsync;
|
tempGrab.pointerMode = GrabModeAsync;
|
||||||
tempGrab.confineTo = NullWindow;
|
tempGrab.confineTo = NullWindow;
|
||||||
tempGrab.cursor = NullCursor;
|
tempGrab.cursor = NullCursor;
|
||||||
tempGrab.genericMasks = NULL;
|
|
||||||
tempGrab.next = NULL;
|
tempGrab.next = NULL;
|
||||||
(*dev->deviceGrab.ActivateGrab) (dev, &tempGrab, currentTime, TRUE);
|
(*dev->deviceGrab.ActivateGrab) (dev, &tempGrab, currentTime, TRUE);
|
||||||
}
|
}
|
||||||
|
|
116
Xi/extgrbdev.c
116
Xi/extgrbdev.c
|
@ -86,121 +86,7 @@ SProcXExtendedGrabDevice(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXExtendedGrabDevice(ClientPtr client)
|
ProcXExtendedGrabDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
xExtendedGrabDeviceReply rep;
|
return BadRequest;
|
||||||
DeviceIntPtr dev;
|
|
||||||
int rc = Success,
|
|
||||||
errval = 0,
|
|
||||||
i;
|
|
||||||
WindowPtr grab_window,
|
|
||||||
confineTo = 0;
|
|
||||||
CursorPtr cursor = NULL;
|
|
||||||
struct tmask tmp[EMASKSIZE];
|
|
||||||
TimeStamp time;
|
|
||||||
XGenericEventMask* xgeMask;
|
|
||||||
GenericMaskPtr gemasks = NULL;
|
|
||||||
|
|
||||||
REQUEST(xExtendedGrabDeviceReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xExtendedGrabDeviceReq);
|
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
|
||||||
rep.RepType = X_ExtendedGrabDevice;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.length = 0;
|
|
||||||
|
|
||||||
if (stuff->length != (sizeof(xExtendedGrabDeviceReq) >> 2) +
|
|
||||||
stuff->event_count + 2 * stuff->generic_event_count)
|
|
||||||
{
|
|
||||||
errval = 0;
|
|
||||||
rc = BadLength;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
|
||||||
if (rc != Success) {
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
rc = dixLookupWindow(&grab_window,
|
|
||||||
stuff->grab_window,
|
|
||||||
client,
|
|
||||||
DixReadAccess);
|
|
||||||
if (rc != Success)
|
|
||||||
{
|
|
||||||
errval = stuff->grab_window;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stuff->confine_to)
|
|
||||||
{
|
|
||||||
rc = dixLookupWindow(&confineTo,
|
|
||||||
stuff->confine_to,
|
|
||||||
client,
|
|
||||||
DixReadAccess);
|
|
||||||
if (rc != Success)
|
|
||||||
{
|
|
||||||
errval = stuff->confine_to;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stuff->cursor)
|
|
||||||
{
|
|
||||||
cursor = (CursorPtr)SecurityLookupIDByType(client,
|
|
||||||
stuff->cursor,
|
|
||||||
RT_CURSOR,
|
|
||||||
DixReadAccess);
|
|
||||||
if (!cursor)
|
|
||||||
{
|
|
||||||
errval = stuff->cursor;
|
|
||||||
rc = BadCursor;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CreateMaskFromList(client,
|
|
||||||
(XEventClass*)&stuff[1],
|
|
||||||
stuff->event_count,
|
|
||||||
tmp,
|
|
||||||
dev,
|
|
||||||
X_GrabDevice) != Success)
|
|
||||||
return Success;
|
|
||||||
|
|
||||||
time = ClientTimeToServerTime(stuff->time);
|
|
||||||
|
|
||||||
if (stuff->generic_event_count)
|
|
||||||
{
|
|
||||||
xgeMask =
|
|
||||||
(XGenericEventMask*)(((XEventClass*)&stuff[1]) + stuff->event_count);
|
|
||||||
|
|
||||||
gemasks = xcalloc(1, sizeof(GenericMaskRec));
|
|
||||||
gemasks->resource = FakeClientID(client->index);
|
|
||||||
gemasks->next = NULL;
|
|
||||||
gemasks->eventMask[xgeMask->extension & 0x7F] = xgeMask->evmask;
|
|
||||||
|
|
||||||
xgeMask++;
|
|
||||||
for (i = 1; i < stuff->generic_event_count; i++, xgeMask++)
|
|
||||||
gemasks->eventMask[xgeMask->extension & 0x7F]= xgeMask->evmask;
|
|
||||||
}
|
|
||||||
|
|
||||||
rep.status = ExtGrabDevice(client, dev, stuff->device_mode,
|
|
||||||
grab_window, confineTo, time,
|
|
||||||
stuff->owner_events, cursor,
|
|
||||||
tmp[stuff->deviceid].mask,
|
|
||||||
gemasks);
|
|
||||||
cleanup:
|
|
||||||
|
|
||||||
if (gemasks)
|
|
||||||
xfree(gemasks);
|
|
||||||
|
|
||||||
if (rc == Success)
|
|
||||||
{
|
|
||||||
WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
51
Xi/extinit.c
51
Xi/extinit.c
|
@ -154,16 +154,6 @@ const Mask XIAllMasks = (1L << 21) - 1;
|
||||||
int ExtEventIndex;
|
int ExtEventIndex;
|
||||||
Mask ExtExclusiveMasks[EMASKSIZE];
|
Mask ExtExclusiveMasks[EMASKSIZE];
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Filters for various generic events.
|
|
||||||
* Evtype is index, mask is value at index.
|
|
||||||
*/
|
|
||||||
static Mask xi_filters[] = {
|
|
||||||
XI_DeviceHierarchyChangedMask,
|
|
||||||
XI_DeviceClassesChangedMask,
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct dev_type
|
static struct dev_type
|
||||||
{
|
{
|
||||||
Atom type;
|
Atom type;
|
||||||
|
@ -671,6 +661,12 @@ SDeviceClassesChangedEvent(deviceClassesChangedEvent* from,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Event swapping function for XI2 events. */
|
||||||
|
static void
|
||||||
|
XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* Allow the specified event to have its propagation suppressed.
|
* Allow the specified event to have its propagation suppressed.
|
||||||
|
@ -1034,36 +1030,6 @@ SEventIDispatch(xEvent * from, xEvent * to)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************
|
|
||||||
*
|
|
||||||
* EventSwap for generic events coming from the GE extension.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void
|
|
||||||
XIGEEventSwap(xGenericEvent* from, xGenericEvent* to)
|
|
||||||
{
|
|
||||||
int n;
|
|
||||||
|
|
||||||
swaps(&from->sequenceNumber, n);
|
|
||||||
switch(from->evtype)
|
|
||||||
{
|
|
||||||
case XI_DeviceClassesChangedNotify:
|
|
||||||
SDeviceClassesChangedEvent((deviceClassesChangedEvent*)from,
|
|
||||||
(deviceClassesChangedEvent*)to);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EventFill to fill various fields for events before they are delivered to
|
|
||||||
* the client.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
XIGEEventFill(xGenericEvent* ev, DeviceIntPtr pDev,
|
|
||||||
WindowPtr pWin, GrabPtr grab)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
*
|
*
|
||||||
* IExtensionInit - initialize the input extension.
|
* IExtensionInit - initialize the input extension.
|
||||||
|
@ -1117,10 +1083,9 @@ XInputExtensionInit(void)
|
||||||
EventSwapVector[DeviceEnterNotify] = SEventIDispatch;
|
EventSwapVector[DeviceEnterNotify] = SEventIDispatch;
|
||||||
EventSwapVector[DeviceLeaveNotify] = SEventIDispatch;
|
EventSwapVector[DeviceLeaveNotify] = SEventIDispatch;
|
||||||
|
|
||||||
/* init GE events */
|
GERegisterExtension(IReqCode, XI2EventSwap, NULL);
|
||||||
GERegisterExtension(IReqCode, XIGEEventSwap, XIGEEventFill);
|
|
||||||
SetGenericFilter(IReqCode, xi_filters);
|
|
||||||
} else {
|
} else {
|
||||||
FatalError("IExtensionInit: AddExtensions failed\n");
|
FatalError("IExtensionInit: AddExtensions failed\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ ProcXiSelectEvent(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
GEWindowSetMask(client, pDev, pWin, IReqCode, stuff->mask);
|
/* XXX: THIS FUNCTION IS NOW DYSFUNCTIONAL */
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
307
dix/events.c
307
dix/events.c
|
@ -396,13 +396,6 @@ static Mask filters[MAXDEVICES][128] = {
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* same principle as filters, but one set of filters for each extension.
|
|
||||||
* The extension is responsible for setting the filters by calling
|
|
||||||
* SetGenericFilter().
|
|
||||||
*/
|
|
||||||
static Mask* generic_filters[MAXEXTENSIONS];
|
|
||||||
|
|
||||||
static CARD8 criticalEvents[32] =
|
static CARD8 criticalEvents[32] =
|
||||||
{
|
{
|
||||||
0x7c, 0x30, 0x40 /* key, button, expose, and configure events */
|
0x7c, 0x30, 0x40 /* key, button, expose, and configure events */
|
||||||
|
@ -1466,13 +1459,6 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
|
||||||
mouse->deviceGrab.sync.state = NOT_GRABBED;
|
mouse->deviceGrab.sync.state = NOT_GRABBED;
|
||||||
mouse->deviceGrab.fromPassiveGrab = FALSE;
|
mouse->deviceGrab.fromPassiveGrab = FALSE;
|
||||||
|
|
||||||
/* make sure the potential XGE event mask is freed too*/
|
|
||||||
if (grab->genericMasks)
|
|
||||||
{
|
|
||||||
xfree(grab->genericMasks);
|
|
||||||
grab->genericMasks = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next)
|
for (dev = inputInfo.devices; dev; dev = dev->next)
|
||||||
{
|
{
|
||||||
if (dev->deviceGrab.sync.other == grab)
|
if (dev->deviceGrab.sync.other == grab)
|
||||||
|
@ -1550,11 +1536,6 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
|
||||||
keybd->deviceGrab.grab = NullGrab;
|
keybd->deviceGrab.grab = NullGrab;
|
||||||
keybd->deviceGrab.sync.state = NOT_GRABBED;
|
keybd->deviceGrab.sync.state = NOT_GRABBED;
|
||||||
keybd->deviceGrab.fromPassiveGrab = FALSE;
|
keybd->deviceGrab.fromPassiveGrab = FALSE;
|
||||||
if (grab->genericMasks)
|
|
||||||
{
|
|
||||||
xfree(grab->genericMasks);
|
|
||||||
grab->genericMasks = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next)
|
for (dev = inputInfo.devices; dev; dev = dev->next)
|
||||||
{
|
{
|
||||||
|
@ -1937,43 +1918,6 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
|
||||||
}
|
}
|
||||||
if (filter != CantBeFiltered)
|
if (filter != CantBeFiltered)
|
||||||
{
|
{
|
||||||
/* Handle generic events */
|
|
||||||
if (type == GenericEvent)
|
|
||||||
{
|
|
||||||
GenericMaskPtr gmask;
|
|
||||||
/* We don't do more than one GenericEvent at a time. */
|
|
||||||
if (count > 1)
|
|
||||||
{
|
|
||||||
ErrorF("[dix] Do not send more than one GenericEvent at a time!\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* if we get here, filter should be set to the GE specific mask.
|
|
||||||
check if any client wants it */
|
|
||||||
if (!GEDeviceMaskIsSet(pWin, pDev, GEEXT(pEvents), filter))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* run through all clients, deliver event */
|
|
||||||
for (gmask = GECLIENT(pWin); gmask; gmask = gmask->next)
|
|
||||||
{
|
|
||||||
if (gmask->eventMask[GEEXTIDX(pEvents)] & filter)
|
|
||||||
{
|
|
||||||
if (XaceHook(XACE_RECEIVE_ACCESS, rClient(gmask), pWin,
|
|
||||||
pEvents, count))
|
|
||||||
/* do nothing */;
|
|
||||||
else if (TryClientEvents(rClient(gmask), pDev,
|
|
||||||
pEvents, count,
|
|
||||||
gmask->eventMask[GEEXTIDX(pEvents)],
|
|
||||||
filter, grab) > 0)
|
|
||||||
{
|
|
||||||
deliveries++;
|
|
||||||
} else
|
|
||||||
nondeliveries--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* Traditional event */
|
|
||||||
if (type & EXTENSION_EVENT_BASE)
|
if (type & EXTENSION_EVENT_BASE)
|
||||||
{
|
{
|
||||||
OtherInputMasks *inputMasks;
|
OtherInputMasks *inputMasks;
|
||||||
|
@ -2010,7 +1954,6 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
|
||||||
nondeliveries--;
|
nondeliveries--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Note that since core events are delivered first, an implicit grab may
|
* Note that since core events are delivered first, an implicit grab may
|
||||||
|
@ -2039,21 +1982,6 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
|
||||||
inputMasks = wOtherInputMasks(pWin);
|
inputMasks = wOtherInputMasks(pWin);
|
||||||
tempGrab.deviceMask = (inputMasks) ? inputMasks->inputEvents[pDev->id]: 0;
|
tempGrab.deviceMask = (inputMasks) ? inputMasks->inputEvents[pDev->id]: 0;
|
||||||
|
|
||||||
/* get the XGE event mask. */
|
|
||||||
tempGrab.genericMasks = NULL;
|
|
||||||
if (pWin->optional && pWin->optional->geMasks)
|
|
||||||
{
|
|
||||||
GenericClientMasksPtr gemasks = pWin->optional->geMasks;
|
|
||||||
GenericMaskPtr geclient = gemasks->geClients;
|
|
||||||
while(geclient && rClient(geclient) != client)
|
|
||||||
geclient = geclient->next;
|
|
||||||
if (geclient)
|
|
||||||
{
|
|
||||||
tempGrab.genericMasks = xcalloc(1, sizeof(GenericMaskRec));
|
|
||||||
*tempGrab.genericMasks = *geclient;
|
|
||||||
tempGrab.genericMasks->next = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(*pDev->deviceGrab.ActivateGrab)(pDev, &tempGrab,
|
(*pDev->deviceGrab.ActivateGrab)(pDev, &tempGrab,
|
||||||
currentTime, TRUE | ImplicitGrabMask);
|
currentTime, TRUE | ImplicitGrabMask);
|
||||||
}
|
}
|
||||||
|
@ -2269,39 +2197,6 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab,
|
||||||
type = xE->u.u.type;
|
type = xE->u.u.type;
|
||||||
filter = filters[dev->id][type];
|
filter = filters[dev->id][type];
|
||||||
|
|
||||||
/* handle generic events */
|
|
||||||
/* XXX: Generic events aren't quite handled correctly yet. They should
|
|
||||||
* eventually fit in with the rest of the stuff
|
|
||||||
*/
|
|
||||||
if (type == GenericEvent)
|
|
||||||
{
|
|
||||||
WindowPtr win = pWin;
|
|
||||||
xGenericEvent* ge = (xGenericEvent*)xE;
|
|
||||||
|
|
||||||
if (count > 1)
|
|
||||||
{
|
|
||||||
ErrorF("[dix] Do not send more than one GenericEvent at a time!\n");
|
|
||||||
deliveries = 0;
|
|
||||||
goto unwind;
|
|
||||||
}
|
|
||||||
filter = generic_filters[GEEXTIDX(xE)][ge->evtype];
|
|
||||||
|
|
||||||
while(win)
|
|
||||||
{
|
|
||||||
if (GEDeviceMaskIsSet(win, dev, GEEXT(xE), filter))
|
|
||||||
{
|
|
||||||
if (GEExtensions[GEEXTIDX(xE)].evfill)
|
|
||||||
GEExtensions[GEEXTIDX(xE)].evfill(ge, dev, win, grab);
|
|
||||||
deliveries = DeliverEventsToWindow(dev, win, xE, count,
|
|
||||||
filter, grab, 0);
|
|
||||||
if (deliveries > 0)
|
|
||||||
goto unwind;
|
|
||||||
}
|
|
||||||
|
|
||||||
win = win->parent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (pWin && type != GenericEvent)
|
while (pWin && type != GenericEvent)
|
||||||
{
|
{
|
||||||
/* First try XI event delivery */
|
/* First try XI event delivery */
|
||||||
|
@ -3537,6 +3432,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
|
||||||
}
|
}
|
||||||
if (!deliveries)
|
if (!deliveries)
|
||||||
{
|
{
|
||||||
|
Mask mask;
|
||||||
/* XXX: In theory, we could pass the internal events through to
|
/* XXX: In theory, we could pass the internal events through to
|
||||||
* everything and only convert just before hitting the wire. We can't
|
* everything and only convert just before hitting the wire. We can't
|
||||||
* do that yet, so DGE is the last stop for internal events. From here
|
* do that yet, so DGE is the last stop for internal events. From here
|
||||||
|
@ -3552,80 +3448,63 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
|
||||||
} else if (count == 0) /* no XI/Core event for you */
|
} else if (count == 0) /* no XI/Core event for you */
|
||||||
goto unwind;
|
goto unwind;
|
||||||
|
|
||||||
if (xi->u.u.type == GenericEvent)
|
mask = grab->eventMask;
|
||||||
|
|
||||||
|
sendCore = (thisDev->isMaster && thisDev->coreEvents);
|
||||||
|
/* try core event */
|
||||||
|
if (sendCore && grab->coreGrab)
|
||||||
{
|
{
|
||||||
/* find evmask for event's extension */
|
xEvent core;
|
||||||
xGenericEvent* ge = ((xGenericEvent*)xi);
|
|
||||||
GenericMaskPtr gemask = grab->genericMasks;
|
|
||||||
|
|
||||||
if (!gemask || !gemask->eventMask[GEEXTIDX(ge)])
|
rc = EventToCore(event, &core);
|
||||||
goto unwind;
|
if (rc != Success && rc != BadMatch)
|
||||||
|
|
||||||
if (GEEventFill(xi))
|
|
||||||
GEEventFill(xi)(ge, thisDev, grab->window, grab);
|
|
||||||
deliveries = TryClientEvents(rClient(grab), thisDev, xi,
|
|
||||||
count, gemask->eventMask[GEEXTIDX(ge)],
|
|
||||||
generic_filters[GEEXTIDX(ge)][ge->evtype],
|
|
||||||
grab);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
Mask mask = grab->eventMask;
|
|
||||||
|
|
||||||
sendCore = (thisDev->isMaster && thisDev->coreEvents);
|
|
||||||
/* try core event */
|
|
||||||
if (sendCore && grab->coreGrab)
|
|
||||||
{
|
{
|
||||||
xEvent core;
|
ErrorF("[dix] DeliverGrabbedEvent. Core conversion failed.\n");
|
||||||
|
goto unwind;
|
||||||
rc = EventToCore(event, &core);
|
|
||||||
if (rc != Success && rc != BadMatch)
|
|
||||||
{
|
|
||||||
ErrorF("[dix] DeliverGrabbedEvent. Core conversion failed.\n");
|
|
||||||
goto unwind;
|
|
||||||
}
|
|
||||||
|
|
||||||
FixUpEventFromWindow(thisDev, &core, grab->window,
|
|
||||||
None, TRUE);
|
|
||||||
if (XaceHook(XACE_SEND_ACCESS, 0, thisDev,
|
|
||||||
grab->window, &core, 1) ||
|
|
||||||
XaceHook(XACE_RECEIVE_ACCESS, rClient(grab),
|
|
||||||
grab->window, &core, 1))
|
|
||||||
deliveries = 1; /* don't send, but pretend we did */
|
|
||||||
else if (!IsInterferingGrab(rClient(grab), thisDev, &core))
|
|
||||||
{
|
|
||||||
deliveries = TryClientEvents(rClient(grab), thisDev,
|
|
||||||
&core, 1, mask,
|
|
||||||
filters[thisDev->id][core.u.u.type],
|
|
||||||
grab);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!deliveries)
|
FixUpEventFromWindow(thisDev, &core, grab->window,
|
||||||
|
None, TRUE);
|
||||||
|
if (XaceHook(XACE_SEND_ACCESS, 0, thisDev,
|
||||||
|
grab->window, &core, 1) ||
|
||||||
|
XaceHook(XACE_RECEIVE_ACCESS, rClient(grab),
|
||||||
|
grab->window, &core, 1))
|
||||||
|
deliveries = 1; /* don't send, but pretend we did */
|
||||||
|
else if (!IsInterferingGrab(rClient(grab), thisDev, &core))
|
||||||
{
|
{
|
||||||
/* try XI event */
|
deliveries = TryClientEvents(rClient(grab), thisDev,
|
||||||
if (grabinfo->fromPassiveGrab &&
|
&core, 1, mask,
|
||||||
grabinfo->implicitGrab)
|
filters[thisDev->id][core.u.u.type],
|
||||||
mask = grab->deviceMask;
|
grab);
|
||||||
FixUpEventFromWindow(thisDev, xi, grab->window,
|
|
||||||
None, TRUE);
|
|
||||||
|
|
||||||
if (XaceHook(XACE_SEND_ACCESS, 0, thisDev,
|
|
||||||
grab->window, xi, count) ||
|
|
||||||
XaceHook(XACE_RECEIVE_ACCESS, rClient(grab),
|
|
||||||
grab->window, xi, count))
|
|
||||||
deliveries = 1; /* don't send, but pretend we did */
|
|
||||||
else
|
|
||||||
{
|
|
||||||
deliveries =
|
|
||||||
TryClientEvents(rClient(grab), thisDev,
|
|
||||||
xi, count,
|
|
||||||
mask,
|
|
||||||
filters[thisDev->id][xi->u.u.type],
|
|
||||||
grab);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!deliveries)
|
||||||
|
{
|
||||||
|
/* try XI event */
|
||||||
|
if (grabinfo->fromPassiveGrab &&
|
||||||
|
grabinfo->implicitGrab)
|
||||||
|
mask = grab->deviceMask;
|
||||||
|
FixUpEventFromWindow(thisDev, xi, grab->window,
|
||||||
|
None, TRUE);
|
||||||
|
|
||||||
|
if (XaceHook(XACE_SEND_ACCESS, 0, thisDev,
|
||||||
|
grab->window, xi, count) ||
|
||||||
|
XaceHook(XACE_RECEIVE_ACCESS, rClient(grab),
|
||||||
|
grab->window, xi, count))
|
||||||
|
deliveries = 1; /* don't send, but pretend we did */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
deliveries =
|
||||||
|
TryClientEvents(rClient(grab), thisDev,
|
||||||
|
xi, count,
|
||||||
|
mask,
|
||||||
|
filters[thisDev->id][xi->u.u.type],
|
||||||
|
grab);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (deliveries && (event->u.any.type == ET_Motion))
|
if (deliveries && (event->u.any.type == ET_Motion))
|
||||||
thisDev->valuator->motionHintWindow = grab->window;
|
thisDev->valuator->motionHintWindow = grab->window;
|
||||||
}
|
}
|
||||||
|
@ -4377,7 +4256,6 @@ ProcGrabPointer(ClientPtr client)
|
||||||
tempGrab.pointerMode = stuff->pointerMode;
|
tempGrab.pointerMode = stuff->pointerMode;
|
||||||
tempGrab.device = device;
|
tempGrab.device = device;
|
||||||
tempGrab.coreGrab = True;
|
tempGrab.coreGrab = True;
|
||||||
tempGrab.genericMasks = NULL;
|
|
||||||
(*device->deviceGrab.ActivateGrab)(device, &tempGrab, time, FALSE);
|
(*device->deviceGrab.ActivateGrab)(device, &tempGrab, time, FALSE);
|
||||||
if (oldCursor)
|
if (oldCursor)
|
||||||
FreeCursor (oldCursor, (Cursor)0);
|
FreeCursor (oldCursor, (Cursor)0);
|
||||||
|
@ -4554,7 +4432,6 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
|
||||||
tempGrab.device = dev;
|
tempGrab.device = dev;
|
||||||
tempGrab.cursor = NULL;
|
tempGrab.cursor = NULL;
|
||||||
tempGrab.coreGrab = coreGrab;
|
tempGrab.coreGrab = coreGrab;
|
||||||
tempGrab.genericMasks = NULL;
|
|
||||||
|
|
||||||
(*grabInfo->ActivateGrab)(dev, &tempGrab, time, FALSE);
|
(*grabInfo->ActivateGrab)(dev, &tempGrab, time, FALSE);
|
||||||
*status = GrabSuccess;
|
*status = GrabSuccess;
|
||||||
|
@ -5569,87 +5446,3 @@ IsInterferingGrab(ClientPtr client, DeviceIntPtr dev, xEvent* event)
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the filters for a extension.
|
|
||||||
* The filters array needs to contain the Masks that are applicable for each
|
|
||||||
* event type for the given extension.
|
|
||||||
* e.g. if generic event type 2 should be let through for windows with
|
|
||||||
* MyExampleMask set, make sure that filters[2] == MyExampleMask.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
SetGenericFilter(int extension, Mask* filters)
|
|
||||||
{
|
|
||||||
generic_filters[extension & 0x7f] = filters;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Grab a device for XI events and XGE events.
|
|
||||||
* grabmode is used to ungrab a device.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
ExtGrabDevice(ClientPtr client,
|
|
||||||
DeviceIntPtr dev,
|
|
||||||
int device_mode,
|
|
||||||
WindowPtr grabWindow,
|
|
||||||
WindowPtr confineTo,
|
|
||||||
TimeStamp ctime,
|
|
||||||
Bool ownerEvents,
|
|
||||||
CursorPtr cursor,
|
|
||||||
Mask xi_mask,
|
|
||||||
GenericMaskPtr ge_masks)
|
|
||||||
{
|
|
||||||
GrabInfoPtr grabinfo;
|
|
||||||
GrabRec newGrab;
|
|
||||||
|
|
||||||
UpdateCurrentTime();
|
|
||||||
|
|
||||||
grabinfo = &dev->deviceGrab;
|
|
||||||
|
|
||||||
if (grabinfo->grab && !SameClient(grabinfo->grab, client))
|
|
||||||
return AlreadyGrabbed;
|
|
||||||
|
|
||||||
if (!grabWindow->realized)
|
|
||||||
return GrabNotViewable;
|
|
||||||
|
|
||||||
if ((CompareTimeStamps(ctime, currentTime) == LATER) ||
|
|
||||||
(CompareTimeStamps(ctime, grabinfo->grabTime) == EARLIER))
|
|
||||||
return GrabInvalidTime;
|
|
||||||
|
|
||||||
if (grabinfo->sync.frozen && grabinfo->sync.other &&
|
|
||||||
!SameClient(grabinfo->sync.other, client))
|
|
||||||
return GrabFrozen;
|
|
||||||
|
|
||||||
memset(&newGrab, 0, sizeof(GrabRec));
|
|
||||||
newGrab.window = grabWindow;
|
|
||||||
newGrab.resource = client->clientAsMask;
|
|
||||||
newGrab.ownerEvents = ownerEvents;
|
|
||||||
newGrab.device = dev;
|
|
||||||
newGrab.cursor = cursor;
|
|
||||||
newGrab.confineTo = confineTo;
|
|
||||||
newGrab.eventMask = xi_mask;
|
|
||||||
newGrab.genericMasks = NULL;
|
|
||||||
newGrab.next = NULL;
|
|
||||||
|
|
||||||
if (ge_masks)
|
|
||||||
{
|
|
||||||
newGrab.genericMasks = xcalloc(1, sizeof(GenericMaskRec));
|
|
||||||
*newGrab.genericMasks = *ge_masks;
|
|
||||||
newGrab.genericMasks->next = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsPointerDevice(dev))
|
|
||||||
{
|
|
||||||
newGrab.keyboardMode = GrabModeAsync;
|
|
||||||
newGrab.pointerMode = device_mode;
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
newGrab.keyboardMode = device_mode;
|
|
||||||
newGrab.pointerMode = GrabModeAsync;
|
|
||||||
}
|
|
||||||
|
|
||||||
(*grabinfo->ActivateGrab)(dev, &newGrab, ctime, FALSE);
|
|
||||||
return GrabSuccess;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,6 @@ CreateGrab(
|
||||||
grab->detail.pMask = NULL;
|
grab->detail.pMask = NULL;
|
||||||
grab->confineTo = confineTo;
|
grab->confineTo = confineTo;
|
||||||
grab->cursor = cursor;
|
grab->cursor = cursor;
|
||||||
grab->genericMasks = NULL;
|
|
||||||
grab->next = NULL;
|
grab->next = NULL;
|
||||||
if (cursor)
|
if (cursor)
|
||||||
cursor->refcnt++;
|
cursor->refcnt++;
|
||||||
|
|
35
dix/window.c
35
dix/window.c
|
@ -403,13 +403,6 @@ CreateRootWindow(ScreenPtr pScreen)
|
||||||
pWin->optional->inputShape = NULL;
|
pWin->optional->inputShape = NULL;
|
||||||
pWin->optional->inputMasks = NULL;
|
pWin->optional->inputMasks = NULL;
|
||||||
pWin->optional->deviceCursors = NULL;
|
pWin->optional->deviceCursors = NULL;
|
||||||
pWin->optional->geMasks = (GenericClientMasksPtr)xcalloc(1, sizeof(GenericClientMasksRec));
|
|
||||||
if (!pWin->optional->geMasks)
|
|
||||||
{
|
|
||||||
xfree(pWin->optional);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
pWin->optional->colormap = pScreen->defColormap;
|
pWin->optional->colormap = pScreen->defColormap;
|
||||||
pWin->optional->visual = pScreen->rootVisual;
|
pWin->optional->visual = pScreen->rootVisual;
|
||||||
|
|
||||||
|
@ -792,8 +785,6 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
|
||||||
static void
|
static void
|
||||||
DisposeWindowOptional (WindowPtr pWin)
|
DisposeWindowOptional (WindowPtr pWin)
|
||||||
{
|
{
|
||||||
GenericMaskPtr gmask = NULL, next = NULL;
|
|
||||||
|
|
||||||
if (!pWin->optional)
|
if (!pWin->optional)
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
|
@ -824,17 +815,6 @@ DisposeWindowOptional (WindowPtr pWin)
|
||||||
pWin->optional->deviceCursors = NULL;
|
pWin->optional->deviceCursors = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove generic event mask allocations */
|
|
||||||
if (pWin->optional->geMasks)
|
|
||||||
gmask = pWin->optional->geMasks->geClients;
|
|
||||||
while(gmask)
|
|
||||||
{
|
|
||||||
next = gmask->next;
|
|
||||||
xfree(gmask);
|
|
||||||
gmask = next;
|
|
||||||
}
|
|
||||||
xfree (pWin->optional->geMasks);
|
|
||||||
|
|
||||||
xfree (pWin->optional);
|
xfree (pWin->optional);
|
||||||
pWin->optional = NULL;
|
pWin->optional = NULL;
|
||||||
}
|
}
|
||||||
|
@ -3443,9 +3423,6 @@ CheckWindowOptionalNeed (WindowPtr w)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (optional->geMasks != NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
parentOptional = FindWindowWithOptional(w)->optional;
|
parentOptional = FindWindowWithOptional(w)->optional;
|
||||||
if (optional->visual != parentOptional->visual)
|
if (optional->visual != parentOptional->visual)
|
||||||
return;
|
return;
|
||||||
|
@ -3489,18 +3466,6 @@ MakeWindowOptional (WindowPtr pWin)
|
||||||
optional->inputMasks = NULL;
|
optional->inputMasks = NULL;
|
||||||
optional->deviceCursors = NULL;
|
optional->deviceCursors = NULL;
|
||||||
|
|
||||||
optional->geMasks = xalloc(sizeof(GenericClientMasksRec));
|
|
||||||
if (!optional->geMasks)
|
|
||||||
{
|
|
||||||
xfree(optional);
|
|
||||||
return FALSE;
|
|
||||||
} else {
|
|
||||||
int i;
|
|
||||||
optional->geMasks->geClients = 0;
|
|
||||||
for (i = 0; i < MAXEXTENSIONS; i++)
|
|
||||||
optional->geMasks->eventMasks[i] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
parentOptional = FindWindowWithOptional(pWin)->optional;
|
parentOptional = FindWindowWithOptional(pWin)->optional;
|
||||||
optional->visual = parentOptional->visual;
|
optional->visual = parentOptional->visual;
|
||||||
if (!pWin->cursorIsNone)
|
if (!pWin->cursorIsNone)
|
||||||
|
|
|
@ -611,16 +611,4 @@ extern _X_EXPORT ClientPtr LookupClient(
|
||||||
XID id,
|
XID id,
|
||||||
ClientPtr client);
|
ClientPtr client);
|
||||||
|
|
||||||
/* GE stuff */
|
|
||||||
extern _X_EXPORT void SetGenericFilter(int extension, Mask* filters);
|
|
||||||
extern _X_EXPORT int ExtGrabDevice(ClientPtr client,
|
|
||||||
DeviceIntPtr dev,
|
|
||||||
int device_mode,
|
|
||||||
WindowPtr grabWindow,
|
|
||||||
WindowPtr confineTo,
|
|
||||||
TimeStamp ctime,
|
|
||||||
Bool ownerEvents,
|
|
||||||
CursorPtr cursor,
|
|
||||||
Mask xi_mask,
|
|
||||||
GenericMaskPtr ge_masks);
|
|
||||||
#endif /* DIX_H */
|
#endif /* DIX_H */
|
||||||
|
|
|
@ -175,7 +175,6 @@ typedef struct _GrabRec {
|
||||||
CursorPtr cursor; /* always NULL for keyboards */
|
CursorPtr cursor; /* always NULL for keyboards */
|
||||||
Mask eventMask;
|
Mask eventMask;
|
||||||
Mask deviceMask;
|
Mask deviceMask;
|
||||||
GenericMaskPtr genericMasks;
|
|
||||||
} GrabRec;
|
} GrabRec;
|
||||||
|
|
||||||
typedef struct _KeyClassRec {
|
typedef struct _KeyClassRec {
|
||||||
|
|
|
@ -79,16 +79,6 @@ typedef struct _DevCursorNode {
|
||||||
struct _DevCursorNode* next;
|
struct _DevCursorNode* next;
|
||||||
} DevCursNodeRec, *DevCursNodePtr, *DevCursorList;
|
} DevCursNodeRec, *DevCursNodePtr, *DevCursorList;
|
||||||
|
|
||||||
/* Mask structure for GE extension as stored on the window.
|
|
||||||
* Allows one mask per extension.
|
|
||||||
* .eventMask - Summary mask for all clients, used for quick checking.
|
|
||||||
* .geClients - list of clients with their specific mask.
|
|
||||||
*/
|
|
||||||
typedef struct _GenericClientMasks {
|
|
||||||
Mask eventMasks[MAXEXTENSIONS];
|
|
||||||
GenericMaskPtr geClients;
|
|
||||||
} GenericClientMasksRec, *GenericClientMasksPtr;
|
|
||||||
|
|
||||||
typedef struct _WindowOpt {
|
typedef struct _WindowOpt {
|
||||||
VisualID visual; /* default: same as parent */
|
VisualID visual; /* default: same as parent */
|
||||||
CursorPtr cursor; /* default: window.cursorNone */
|
CursorPtr cursor; /* default: window.cursorNone */
|
||||||
|
@ -105,7 +95,6 @@ typedef struct _WindowOpt {
|
||||||
RegionPtr inputShape; /* default: NULL */
|
RegionPtr inputShape; /* default: NULL */
|
||||||
struct _OtherInputMasks *inputMasks; /* default: NULL */
|
struct _OtherInputMasks *inputMasks; /* default: NULL */
|
||||||
DevCursorList deviceCursors; /* default: NULL */
|
DevCursorList deviceCursors; /* default: NULL */
|
||||||
struct _GenericClientMasks *geMasks; /* default: NULL */
|
|
||||||
} WindowOptRec, *WindowOptPtr;
|
} WindowOptRec, *WindowOptPtr;
|
||||||
|
|
||||||
#define BackgroundPixel 2L
|
#define BackgroundPixel 2L
|
||||||
|
|
Loading…
Reference in New Issue