summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2007-05-17 17:59:02 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2007-05-17 17:59:02 +0930
commit333bab4b235801efd2b2de5b60df5b0c44048d3e (patch)
treede742ef0c84bb51a725dcb3c036f84978ba59014
parentbc334286b060bc8d0c829b18acebadf24fbdaf19 (diff)
Clean up, correct some comments.
Send event type down with the RawEvents.
-rw-r--r--Xext/geext.c12
-rw-r--r--Xext/geext.h1
-rw-r--r--Xi/exglobals.h2
-rw-r--r--Xi/extinit.c11
-rw-r--r--dix/events.c21
-rw-r--r--dix/getevents.c1
6 files changed, 19 insertions, 29 deletions
diff --git a/Xext/geext.c b/Xext/geext.c
index fed74dc54..f0801cbf8 100644
--- a/Xext/geext.c
+++ b/Xext/geext.c
@@ -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,
@@ -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;
diff --git a/Xext/geext.h b/Xext/geext.h
index 53aa21c8b..7a73e81e6 100644
--- a/Xext/geext.h
+++ b/Xext/geext.h
@@ -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,
diff --git a/Xi/exglobals.h b/Xi/exglobals.h
index 8fcd907a3..8cbccf294 100644
--- a/Xi/exglobals.h
+++ b/Xi/exglobals.h
@@ -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;
@@ -73,7 +72,6 @@ extern int ChangeDeviceNotify;
extern int DevicePresenceNotify;
extern int DeviceEnterNotify;
extern int DeviceLeaveNotify;
-extern int PointerKeyboardPairingChangedNotify;
extern int RT_INPUTCLIENT;
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 088873062..99518e125 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -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,
@@ -213,9 +217,6 @@ int DevicePresenceNotify;
int DeviceEnterNotify;
int DeviceLeaveNotify;
-/* GE events */
-int PointerKeyboardPairingChangedNotify;
-
int RT_INPUTCLIENT;
/*****************************************************************
@@ -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;
diff --git a/dix/events.c b/dix/events.c
index 463bf7c25..b36e4a459 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -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,
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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");
@@ -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);
@@ -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))
@@ -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);
diff --git a/dix/getevents.c b/dix/getevents.c
index 4f7993f0a..4d1fbb7e4 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -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;