Skip to content

Commit

Permalink
Clean up, correct some comments.
Browse files Browse the repository at this point in the history
Send event type down with the RawEvents.
  • Loading branch information
Peter Hutterer committed May 17, 2007
1 parent bc33428 commit 333bab4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 29 deletions.
12 changes: 6 additions & 6 deletions Xext/geext.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,10 @@ GEExtensionInit(void)
/* interface for extensions */
/************************************************************/

/* Register extension with GE.
* Requires the event swap function as parameter. The function will be called
* each time an event is sent to a client with different byte order.
* Returns extension offset. This offset is to be used in all generic events
* sent to the client.
/* Register an extension with GE. The given swap function will be called each
* time an event is sent to a client with different byte order.
* @param extension The extensions major opcode
* @param ev_swap the event swap function.
*/
void GERegisterExtension(
int extension,
Expand All @@ -266,7 +265,8 @@ void GERegisterExtension(


/* Sets type and extension field for a generic event. This is just an
* auxiliary function, extensions could do it manually too. */
* auxiliary function, extensions could do it manually too.
*/
void GEInitEvent(xGenericEvent* ev, int extension)
{
ev->type = GenericEvent;
Expand Down
1 change: 0 additions & 1 deletion Xext/geext.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ from the author.
(((pWin)->optional) ? (pWin)->optional->geMasks->geClients : NULL)

/* Interface for other extensions */
Mask GENextMask(int extension);
void GEWindowSetMask(ClientPtr pClient, WindowPtr pWin, int extension, Mask mask);
void GERegisterExtension(
int extension,
Expand Down
2 changes: 0 additions & 2 deletions Xi/exglobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ extern Mask DeviceButtonMotionMask;
extern Mask DevicePresenceNotifyMask;
extern Mask DeviceEnterWindowMask;
extern Mask DeviceLeaveWindowMask;
extern Mask PointerKeyboardPairingChangedNotifyMask;
extern Mask PropagateMask[];

extern int DeviceValuator;
Expand All @@ -73,7 +72,6 @@ extern int ChangeDeviceNotify;
extern int DevicePresenceNotify;
extern int DeviceEnterNotify;
extern int DeviceLeaveNotify;
extern int PointerKeyboardPairingChangedNotify;

extern int RT_INPUTCLIENT;

Expand Down
11 changes: 4 additions & 7 deletions Xi/extinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ Mask ExtValidMasks[EMASKSIZE];
Mask ExtExclusiveMasks[EMASKSIZE];


/**
* Filters for various generic events.
* Evtype is index, mask is value at index.
*/
static Mask xi_filters[3] = {
XI_PointerKeyboardPairingChangedMask,
XI_RandomStringMask,
Expand Down Expand Up @@ -213,9 +217,6 @@ int DevicePresenceNotify;
int DeviceEnterNotify;
int DeviceLeaveNotify;

/* GE events */
int PointerKeyboardPairingChangedNotify;

int RT_INPUTCLIENT;

/*****************************************************************
Expand Down Expand Up @@ -828,10 +829,6 @@ FixExtensionEvents(ExtensionEntry * extEntry)
DeviceEnterNotify = DevicePresenceNotify + 1;
DeviceLeaveNotify = DeviceEnterNotify + 1;

/* GE Events */
PointerKeyboardPairingChangedNotify =
XI_PointerKeyboardPairingChangedNotify;

event_base[KeyClass] = DeviceKeyPress;
event_base[ButtonClass] = DeviceButtonPress;
event_base[ValuatorClass] = DeviceMotionNotify;
Expand Down
21 changes: 8 additions & 13 deletions dix/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,10 +1523,6 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
ComputeFreezes();
}

/*
* Core flag decides whether to work on the deviceGrab or deviceGrab sync
* fields.
*/
void
AllowSome(ClientPtr client,
TimeStamp time,
Expand All @@ -1538,7 +1534,7 @@ AllowSome(ClientPtr client,
TimeStamp grabTime;
DeviceIntPtr dev;
GrabInfoPtr devgrabinfo,
grabinfo = (core) ? &thisDev->deviceGrab : &thisDev->deviceGrab;
grabinfo = &thisDev->deviceGrab;

thisGrabbed = grabinfo->grab && SameClient(grabinfo->grab, client);
thisSynced = FALSE;
Expand All @@ -1547,7 +1543,7 @@ AllowSome(ClientPtr client,
grabTime = grabinfo->grabTime;
for (dev = inputInfo.devices; dev; dev = dev->next)
{
devgrabinfo = (core) ? &dev->deviceGrab : &dev->deviceGrab;
devgrabinfo = &dev->deviceGrab;

if (dev == thisDev)
continue;
Expand Down Expand Up @@ -1593,7 +1589,7 @@ AllowSome(ClientPtr client,
{
for (dev = inputInfo.devices; dev; dev = dev->next)
{
devgrabinfo = (core) ? &dev->deviceGrab : &dev->deviceGrab;
devgrabinfo = &dev->deviceGrab;
if (devgrabinfo->grab
&& SameClient(devgrabinfo->grab, client))
devgrabinfo->sync.state = THAWED;
Expand All @@ -1609,7 +1605,7 @@ AllowSome(ClientPtr client,
{
for (dev = inputInfo.devices; dev; dev = dev->next)
{
devgrabinfo = (core) ? &dev->deviceGrab : &dev->deviceGrab;
devgrabinfo = &dev->deviceGrab;
if (devgrabinfo->grab
&& SameClient(devgrabinfo->grab, client))
devgrabinfo->sync.state = FREEZE_BOTH_NEXT_EVENT;
Expand Down Expand Up @@ -1902,7 +1898,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
if (type == GenericEvent)
{
GEClientPtr pClient;
/* FIXME: We don't do more than one GenericEvent at a time yet. */
/* We don't do more than one GenericEvent at a time. */
if (count > 1)
{
ErrorF("Do not send more than one GenericEvent at a time!\n");
Expand Down Expand Up @@ -3013,8 +3009,7 @@ CheckPassiveGrabsOnWindow(
tempGrab.modifiersDetail.exact&(~0x1f00);
}
#endif
grabinfo = (xE->u.u.type & EXTENSION_EVENT_BASE) ?
&device->deviceGrab : &device->deviceGrab;
grabinfo = &device->deviceGrab;
(*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);

FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
Expand Down Expand Up @@ -4703,7 +4698,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
GrabPtr grab;
TimeStamp time;
int rc;
GrabInfoPtr grabInfo = (deviceGrab) ? &dev->deviceGrab : &dev->deviceGrab;
GrabInfoPtr grabInfo = &dev->deviceGrab;

UpdateCurrentTime();
if ((this_mode != GrabModeSync) && (this_mode != GrabModeAsync))
Expand Down Expand Up @@ -4751,7 +4746,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
tempGrab.eventMask = mask;
tempGrab.device = dev;
tempGrab.cursor = NULL;
tempGrab.coreGrab = deviceGrab;
tempGrab.coreGrab = (deviceGrab) ? FALSE : TRUE;
tempGrab.genericMasks = NULL;

(*grabInfo->ActivateGrab)(dev, &tempGrab, time, FALSE);
Expand Down
1 change: 1 addition & 0 deletions dix/getevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
ev->evtype = XI_RawDeviceEvent;
ev->extension = IReqCode;
ev->length = (num_valuators > 4) ? (num_valuators - 4) : 0;
ev->event_type = type;
ev->buttons = buttons;
ev->num_valuators = num_valuators;
ev->first_valuator = first_valuator;
Expand Down

0 comments on commit 333bab4

Please sign in to comment.