aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xi')
-rw-r--r--xorg-server/Xi/closedev.c334
-rw-r--r--xorg-server/Xi/exevents.c18
-rw-r--r--xorg-server/Xi/exglobals.h166
-rw-r--r--xorg-server/Xi/extinit.c6
-rw-r--r--xorg-server/Xi/getprop.c2
-rw-r--r--xorg-server/Xi/gtmotion.c3
-rw-r--r--xorg-server/Xi/listdev.c2
-rw-r--r--xorg-server/Xi/opendev.c350
-rw-r--r--xorg-server/Xi/sendexev.c312
-rw-r--r--xorg-server/Xi/stubs.c8
-rw-r--r--xorg-server/Xi/xichangecursor.c2
-rw-r--r--xorg-server/Xi/xiproperty.c39
-rw-r--r--xorg-server/Xi/xiquerypointer.c9
13 files changed, 623 insertions, 628 deletions
diff --git a/xorg-server/Xi/closedev.c b/xorg-server/Xi/closedev.c
index 159ead55c..fcd0ed832 100644
--- a/xorg-server/Xi/closedev.c
+++ b/xorg-server/Xi/closedev.c
@@ -1,167 +1,167 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/***********************************************************************
- *
- * Extension function to close an extension input device.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "scrnintstr.h" /* screen structure */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "XIstubs.h"
-#include "exglobals.h"
-
-#include "closedev.h"
-
-/***********************************************************************
- *
- * This procedure closes an input device.
- *
- */
-
-int
-SProcXCloseDevice(ClientPtr client)
-{
- char n;
-
- REQUEST(xCloseDeviceReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCloseDeviceReq);
- return (ProcXCloseDevice(client));
-}
-
-/***********************************************************************
- *
- * Clear out event selections and passive grabs from a window for the
- * specified device.
- *
- */
-
-static void
-DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
-{
- InputClientsPtr others;
- OtherInputMasks *pOthers;
- GrabPtr grab, next;
-
- if ((pOthers = wOtherInputMasks(pWin)) != 0)
- for (others = pOthers->inputClients; others; others = others->next)
- if (SameClient(others, client))
- others->mask[dev->id] = NoEventMask;
-
- for (grab = wPassiveGrabs(pWin); grab; grab = next) {
- next = grab->next;
- if ((grab->device == dev) &&
- (client->clientAsMask == CLIENT_BITS(grab->resource)))
- FreeResource(grab->resource, RT_NONE);
- }
-}
-
-/***********************************************************************
- *
- * Walk througth the window tree, deleting event selections for this client
- * from this device from all windows.
- *
- */
-
-static void
-DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
-{
- WindowPtr p2;
-
- while (p1) {
- p2 = p1->firstChild;
- DeleteDeviceEvents(dev, p1, client);
- DeleteEventsFromChildren(dev, p2, client);
- p1 = p1->nextSib;
- }
-}
-
-/***********************************************************************
- *
- * This procedure closes an input device.
- *
- */
-
-int
-ProcXCloseDevice(ClientPtr client)
-{
- int rc, i;
- WindowPtr pWin, p1;
- DeviceIntPtr d;
-
- REQUEST(xCloseDeviceReq);
- REQUEST_SIZE_MATCH(xCloseDeviceReq);
-
- rc = dixLookupDevice(&d, stuff->deviceid, client, DixUseAccess);
- if (rc != Success)
- return rc;
-
- if (d->deviceGrab.grab && SameClient(d->deviceGrab.grab, client))
- (*d->deviceGrab.DeactivateGrab) (d); /* release active grab */
-
- /* Remove event selections from all windows for events from this device
- * and selected by this client.
- * Delete passive grabs from all windows for this device. */
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- pWin = WindowTable[i];
- DeleteDeviceEvents(d, pWin, client);
- p1 = pWin->firstChild;
- DeleteEventsFromChildren(d, p1, client);
- }
-
- CloseInputDevice(d, client);
- return Success;
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/***********************************************************************
+ *
+ * Extension function to close an extension input device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* window structure */
+#include "scrnintstr.h" /* screen structure */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "XIstubs.h"
+#include "exglobals.h"
+
+#include "closedev.h"
+
+/***********************************************************************
+ *
+ * This procedure closes an input device.
+ *
+ */
+
+int
+SProcXCloseDevice(ClientPtr client)
+{
+ char n;
+
+ REQUEST(xCloseDeviceReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xCloseDeviceReq);
+ return (ProcXCloseDevice(client));
+}
+
+/***********************************************************************
+ *
+ * Clear out event selections and passive grabs from a window for the
+ * specified device.
+ *
+ */
+
+static void
+DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
+{
+ InputClientsPtr others;
+ OtherInputMasks *pOthers;
+ GrabPtr grab, next;
+
+ if ((pOthers = wOtherInputMasks(pWin)) != 0)
+ for (others = pOthers->inputClients; others; others = others->next)
+ if (SameClient(others, client))
+ others->mask[dev->id] = NoEventMask;
+
+ for (grab = wPassiveGrabs(pWin); grab; grab = next) {
+ next = grab->next;
+ if ((grab->device == dev) &&
+ (client->clientAsMask == CLIENT_BITS(grab->resource)))
+ FreeResource(grab->resource, RT_NONE);
+ }
+}
+
+/***********************************************************************
+ *
+ * Walk througth the window tree, deleting event selections for this client
+ * from this device from all windows.
+ *
+ */
+
+static void
+DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
+{
+ WindowPtr p2;
+
+ while (p1) {
+ p2 = p1->firstChild;
+ DeleteDeviceEvents(dev, p1, client);
+ DeleteEventsFromChildren(dev, p2, client);
+ p1 = p1->nextSib;
+ }
+}
+
+/***********************************************************************
+ *
+ * This procedure closes an input device.
+ *
+ */
+
+int
+ProcXCloseDevice(ClientPtr client)
+{
+ int rc, i;
+ WindowPtr pWin, p1;
+ DeviceIntPtr d;
+
+ REQUEST(xCloseDeviceReq);
+ REQUEST_SIZE_MATCH(xCloseDeviceReq);
+
+ rc = dixLookupDevice(&d, stuff->deviceid, client, DixUseAccess);
+ if (rc != Success)
+ return rc;
+
+ if (d->deviceGrab.grab && SameClient(d->deviceGrab.grab, client))
+ (*d->deviceGrab.DeactivateGrab) (d); /* release active grab */
+
+ /* Remove event selections from all windows for events from this device
+ * and selected by this client.
+ * Delete passive grabs from all windows for this device. */
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ pWin = screenInfo.screens[i]->root;
+ DeleteDeviceEvents(d, pWin, client);
+ p1 = pWin->firstChild;
+ DeleteEventsFromChildren(d, p1, client);
+ }
+
+ CloseInputDevice(d, client);
+ return Success;
+}
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c
index de1048ed4..d1d87a639 100644
--- a/xorg-server/Xi/exevents.c
+++ b/xorg-server/Xi/exevents.c
@@ -193,16 +193,12 @@ void
CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
{
KeyClassPtr mk = master->key;
- KeyClassPtr dk = device->key;
- int i;
if (device == master)
return;
mk->sourceid = device->id;
- for (i = 0; i < 8; i++)
- mk->modifierKeyCount[i] = dk->modifierKeyCount[i];
if (!XkbCopyDeviceKeymap(master, device))
FatalError("Couldn't pivot keymap from device to core!\n");
@@ -926,7 +922,7 @@ ProcessRawEvent(RawDeviceEvent *ev, DeviceIntPtr device)
}
for (i = 0; i < screenInfo.numScreens; i++)
- DeliverEventsToWindow(device, WindowTable[i], xi, 1,
+ DeliverEventsToWindow(device, screenInfo.screens[i]->root, xi, 1,
GetEventFilter(device, xi), NULL);
free(xi);
}
@@ -1042,7 +1038,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
/* see comment in EnqueueEvents regarding the next three lines */
if (ev->any.type == ET_Motion)
- ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
+ ev->device_event.root = pSprite->hotPhys.pScreen->root->drawable.id;
eventinfo.device = device;
eventinfo.event = ev;
@@ -1702,7 +1698,7 @@ InputClientGone(WindowPtr pWin, XID id)
InputClientsPtr other, prev;
if (!wOtherInputMasks(pWin))
- return (Success);
+ return Success;
prev = 0;
for (other = wOtherInputMasks(pWin)->inputClients; other;
other = other->next) {
@@ -1728,7 +1724,7 @@ InputClientGone(WindowPtr pWin, XID id)
free(other);
}
RecalculateDeviceDeliverableEvents(pWin);
- return (Success);
+ return Success;
}
prev = other;
}
@@ -1829,7 +1825,7 @@ ChangeKeyMapping(ClientPtr client,
KeyClassPtr k = dev->key;
if (k == NULL)
- return (BadMatch);
+ return BadMatch;
if (len != (keyCodes * keySymsPerKeyCode))
return BadLength;
@@ -1972,7 +1968,7 @@ MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * pEvents, Mask mask)
pEvents->detail = NotifyNormal;
}
}
- return (0);
+ return 0;
}
void
@@ -2120,7 +2116,7 @@ SendEventToAllWindows(DeviceIntPtr dev, Mask mask, xEvent * ev, int count)
WindowPtr pWin, p1;
for (i = 0; i < screenInfo.numScreens; i++) {
- pWin = WindowTable[i];
+ pWin = screenInfo.screens[i]->root;
if (!pWin)
continue;
DeliverEventsToWindow(dev, pWin, ev, count, mask, NullGrab);
diff --git a/xorg-server/Xi/exglobals.h b/xorg-server/Xi/exglobals.h
index 2d2d25c0b..4f09e6ca3 100644
--- a/xorg-server/Xi/exglobals.h
+++ b/xorg-server/Xi/exglobals.h
@@ -1,82 +1,84 @@
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/*****************************************************************
- *
- * Globals referenced elsewhere in the server.
- *
- */
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-#include "privates.h"
-
-#ifndef EXGLOBALS_H
-#define EXGLOBALS_H 1
-
-extern int IReqCode;
-extern int IEventBase;
-extern int BadDevice;
-extern int BadMode;
-extern int DeviceBusy;
-extern int BadClass;
-
-/* Note: only the ones needed in files other than extinit.c are declared */
-extern const Mask DevicePointerMotionMask;
-extern const Mask DevicePointerMotionHintMask;
-extern const Mask DeviceFocusChangeMask;
-extern const Mask DeviceStateNotifyMask;
-extern const Mask DeviceMappingNotifyMask;
-extern const Mask DeviceOwnerGrabButtonMask;
-extern const Mask DeviceButtonGrabMask;
-extern const Mask DeviceButtonMotionMask;
-extern const Mask DevicePresenceNotifyMask;
-extern const Mask DevicePropertyNotifyMask;
-extern const Mask XIAllMasks;
-
-extern Mask PropagateMask[];
-
-extern int DeviceValuator;
-extern int DeviceKeyPress;
-extern int DeviceKeyRelease;
-extern int DeviceButtonPress;
-extern int DeviceButtonRelease;
-extern int DeviceMotionNotify;
-extern int DeviceFocusIn;
-extern int DeviceFocusOut;
-extern int ProximityIn;
-extern int ProximityOut;
-extern int DeviceStateNotify;
-extern int DeviceKeyStateNotify;
-extern int DeviceButtonStateNotify;
-extern int DeviceMappingNotify;
-extern int ChangeDeviceNotify;
-extern int DevicePresenceNotify;
-extern int DevicePropertyNotify;
-
-extern int RT_INPUTCLIENT;
-
-extern DevPrivateKey XIClientPrivateKey;
-#endif /* EXGLOBALS_H */
+/************************************************************
+
+Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of the above listed
+copyright holder(s) not be used in advertising or publicity pertaining
+to distribution of the software without specific, written prior
+permission.
+
+THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
+TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
+LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+
+/*****************************************************************
+ *
+ * Globals referenced elsewhere in the server.
+ *
+ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+#include "privates.h"
+
+#ifndef EXGLOBALS_H
+#define EXGLOBALS_H 1
+
+extern int IReqCode;
+extern int IEventBase;
+extern int BadDevice;
+extern int BadMode;
+extern int DeviceBusy;
+extern int BadClass;
+
+/* Note: only the ones needed in files other than extinit.c are declared */
+extern const Mask DevicePointerMotionMask;
+extern const Mask DevicePointerMotionHintMask;
+extern const Mask DeviceFocusChangeMask;
+extern const Mask DeviceStateNotifyMask;
+extern const Mask DeviceMappingNotifyMask;
+extern const Mask DeviceOwnerGrabButtonMask;
+extern const Mask DeviceButtonGrabMask;
+extern const Mask DeviceButtonMotionMask;
+extern const Mask DevicePresenceNotifyMask;
+extern const Mask DevicePropertyNotifyMask;
+extern const Mask XIAllMasks;
+
+extern Mask PropagateMask[];
+
+extern int DeviceValuator;
+extern int DeviceKeyPress;
+extern int DeviceKeyRelease;
+extern int DeviceButtonPress;
+extern int DeviceButtonRelease;
+extern int DeviceMotionNotify;
+extern int DeviceFocusIn;
+extern int DeviceFocusOut;
+extern int ProximityIn;
+extern int ProximityOut;
+extern int DeviceStateNotify;
+extern int DeviceKeyStateNotify;
+extern int DeviceButtonStateNotify;
+extern int DeviceMappingNotify;
+extern int ChangeDeviceNotify;
+extern int DevicePresenceNotify;
+extern int DevicePropertyNotify;
+
+extern int RT_INPUTCLIENT;
+
+extern DevPrivateKeyRec XIClientPrivateKeyRec;
+#define XIClientPrivateKey (&XIClientPrivateKeyRec)
+
+#endif /* EXGLOBALS_H */
diff --git a/xorg-server/Xi/extinit.c b/xorg-server/Xi/extinit.c
index 9d6c81a5b..58943f08d 100644
--- a/xorg-server/Xi/extinit.c
+++ b/xorg-server/Xi/extinit.c
@@ -377,9 +377,7 @@ Mask PropagateMask[MAXDEVICES];
*
*/
-static int XIClientPrivateKeyIndex;
-DevPrivateKey XIClientPrivateKey = &XIClientPrivateKeyIndex;
-
+DevPrivateKeyRec XIClientPrivateKeyRec;
/*****************************************************************
*
@@ -1256,7 +1254,7 @@ XInputExtensionInit(void)
SERVER_XI_MINOR_VERSION,
};
- if (!dixRequestPrivate(XIClientPrivateKey, sizeof(XIClientRec)))
+ if (!dixRegisterPrivateKey(&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec)))
FatalError("Cannot request private for XI.\n");
if (!AddCallback(&ClientStateCallback, XIClientCallback, 0))
diff --git a/xorg-server/Xi/getprop.c b/xorg-server/Xi/getprop.c
index 8f2d792be..5be09c685 100644
--- a/xorg-server/Xi/getprop.c
+++ b/xorg-server/Xi/getprop.c
@@ -164,7 +164,7 @@ XEventClass
*buf++ = (id << 8) | EventInfo[j].type;
}
}
- return (buf);
+ return buf;
}
/***********************************************************************
diff --git a/xorg-server/Xi/gtmotion.c b/xorg-server/Xi/gtmotion.c
index 930e08c8c..ae69a3c92 100644
--- a/xorg-server/Xi/gtmotion.c
+++ b/xorg-server/Xi/gtmotion.c
@@ -153,8 +153,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
}
WriteToClient(client, length * 4, (char *)coords);
}
- if (coords)
- free(coords);
+ free(coords);
return Success;
}
diff --git a/xorg-server/Xi/listdev.c b/xorg-server/Xi/listdev.c
index 2015f9cdd..52fc85f57 100644
--- a/xorg-server/Xi/listdev.c
+++ b/xorg-server/Xi/listdev.c
@@ -269,7 +269,7 @@ CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf)
*buf += sizeof(xAxisInfo);
}
}
- return (i);
+ return i;
}
static void
diff --git a/xorg-server/Xi/opendev.c b/xorg-server/Xi/opendev.c
index 3844d25a2..092b464ee 100644
--- a/xorg-server/Xi/opendev.c
+++ b/xorg-server/Xi/opendev.c
@@ -1,175 +1,175 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/***********************************************************************
- *
- * Request to open an extension input device.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "XIstubs.h"
-#include "windowstr.h" /* window structure */
-#include "exglobals.h"
-#include "exevents.h"
-
-#include "opendev.h"
-
-extern CARD8 event_base[];
-
-/***********************************************************************
- *
- * This procedure swaps the request if the server and client have different
- * byte orderings.
- *
- */
-
-int
-SProcXOpenDevice(ClientPtr client)
-{
- char n;
-
- REQUEST(xOpenDeviceReq);
- swaps(&stuff->length, n);
- return (ProcXOpenDevice(client));
-}
-
-/***********************************************************************
- *
- * This procedure causes the server to open an input device.
- *
- */
-
-int
-ProcXOpenDevice(ClientPtr client)
-{
- xInputClassInfo evbase[numInputClasses];
- int j = 0;
- int status = Success;
- xOpenDeviceReply rep;
- DeviceIntPtr dev;
-
- REQUEST(xOpenDeviceReq);
- REQUEST_SIZE_MATCH(xOpenDeviceReq);
-
- status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess);
-
- if (status == BadDevice) { /* not open */
- for (dev = inputInfo.off_devices; dev; dev = dev->next)
- if (dev->id == stuff->deviceid)
- break;
- if (dev == NULL)
- return BadDevice;
- } else if (status != Success)
- return status;
-
- if (IsMaster(dev))
- return BadDevice;
-
- OpenInputDevice(dev, client, &status);
- if (status != Success)
- return status;
-
- memset(&rep, 0, sizeof(xOpenDeviceReply));
- rep.repType = X_Reply;
- rep.RepType = X_OpenDevice;
- rep.sequenceNumber = client->sequence;
- if (dev->key != NULL) {
- evbase[j].class = KeyClass;
- evbase[j++].event_type_base = event_base[KeyClass];
- }
- if (dev->button != NULL) {
- evbase[j].class = ButtonClass;
- evbase[j++].event_type_base = event_base[ButtonClass];
- }
- if (dev->valuator != NULL) {
- evbase[j].class = ValuatorClass;
- evbase[j++].event_type_base = event_base[ValuatorClass];
- }
- if (dev->kbdfeed != NULL || dev->ptrfeed != NULL || dev->leds != NULL ||
- dev->intfeed != NULL || dev->bell != NULL || dev->stringfeed != NULL) {
- evbase[j].class = FeedbackClass;
- evbase[j++].event_type_base = event_base[FeedbackClass];
- }
- if (dev->focus != NULL) {
- evbase[j].class = FocusClass;
- evbase[j++].event_type_base = event_base[FocusClass];
- }
- if (dev->proximity != NULL) {
- evbase[j].class = ProximityClass;
- evbase[j++].event_type_base = event_base[ProximityClass];
- }
- evbase[j].class = OtherClass;
- evbase[j++].event_type_base = event_base[OtherClass];
- rep.length = bytes_to_int32(j * sizeof(xInputClassInfo));
- rep.num_classes = j;
- WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
- WriteToClient(client, j * sizeof(xInputClassInfo), (char *)evbase);
- return (Success);
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XOpenDevice function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/***********************************************************************
+ *
+ * Request to open an extension input device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "XIstubs.h"
+#include "windowstr.h" /* window structure */
+#include "exglobals.h"
+#include "exevents.h"
+
+#include "opendev.h"
+
+extern CARD8 event_base[];
+
+/***********************************************************************
+ *
+ * This procedure swaps the request if the server and client have different
+ * byte orderings.
+ *
+ */
+
+int
+SProcXOpenDevice(ClientPtr client)
+{
+ char n;
+
+ REQUEST(xOpenDeviceReq);
+ swaps(&stuff->length, n);
+ return (ProcXOpenDevice(client));
+}
+
+/***********************************************************************
+ *
+ * This procedure causes the server to open an input device.
+ *
+ */
+
+int
+ProcXOpenDevice(ClientPtr client)
+{
+ xInputClassInfo evbase[numInputClasses];
+ int j = 0;
+ int status = Success;
+ xOpenDeviceReply rep;
+ DeviceIntPtr dev;
+
+ REQUEST(xOpenDeviceReq);
+ REQUEST_SIZE_MATCH(xOpenDeviceReq);
+
+ status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess);
+
+ if (status == BadDevice) { /* not open */
+ for (dev = inputInfo.off_devices; dev; dev = dev->next)
+ if (dev->id == stuff->deviceid)
+ break;
+ if (dev == NULL)
+ return BadDevice;
+ } else if (status != Success)
+ return status;
+
+ if (IsMaster(dev))
+ return BadDevice;
+
+ OpenInputDevice(dev, client, &status);
+ if (status != Success)
+ return status;
+
+ memset(&rep, 0, sizeof(xOpenDeviceReply));
+ rep.repType = X_Reply;
+ rep.RepType = X_OpenDevice;
+ rep.sequenceNumber = client->sequence;
+ if (dev->key != NULL) {
+ evbase[j].class = KeyClass;
+ evbase[j++].event_type_base = event_base[KeyClass];
+ }
+ if (dev->button != NULL) {
+ evbase[j].class = ButtonClass;
+ evbase[j++].event_type_base = event_base[ButtonClass];
+ }
+ if (dev->valuator != NULL) {
+ evbase[j].class = ValuatorClass;
+ evbase[j++].event_type_base = event_base[ValuatorClass];
+ }
+ if (dev->kbdfeed != NULL || dev->ptrfeed != NULL || dev->leds != NULL ||
+ dev->intfeed != NULL || dev->bell != NULL || dev->stringfeed != NULL) {
+ evbase[j].class = FeedbackClass;
+ evbase[j++].event_type_base = event_base[FeedbackClass];
+ }
+ if (dev->focus != NULL) {
+ evbase[j].class = FocusClass;
+ evbase[j++].event_type_base = event_base[FocusClass];
+ }
+ if (dev->proximity != NULL) {
+ evbase[j].class = ProximityClass;
+ evbase[j++].event_type_base = event_base[ProximityClass];
+ }
+ evbase[j].class = OtherClass;
+ evbase[j++].event_type_base = event_base[OtherClass];
+ rep.length = bytes_to_int32(j * sizeof(xInputClassInfo));
+ rep.num_classes = j;
+ WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
+ WriteToClient(client, j * sizeof(xInputClassInfo), (char *)evbase);
+ return Success;
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the XOpenDevice function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
+{
+ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ WriteToClient(client, size, (char *)rep);
+}
diff --git a/xorg-server/Xi/sendexev.c b/xorg-server/Xi/sendexev.c
index bd96d74c7..59fe93db7 100644
--- a/xorg-server/Xi/sendexev.c
+++ b/xorg-server/Xi/sendexev.c
@@ -1,156 +1,156 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/***********************************************************************
- *
- * Request to send an extension event.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* Window */
-#include "extnsionst.h" /* EventSwapPtr */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "grabdev.h"
-#include "sendexev.h"
-
-extern int lastEvent; /* Defined in extension.c */
-
-/***********************************************************************
- *
- * Handle requests from clients with a different byte order than us.
- *
- */
-
-int
-SProcXSendExtensionEvent(ClientPtr client)
-{
- char n;
- CARD32 *p;
- int i;
- xEvent eventT;
- xEvent *eventP;
- EventSwapPtr proc;
-
- REQUEST(xSendExtensionEventReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
- swapl(&stuff->destination, n);
- swaps(&stuff->count, n);
-
- if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
- bytes_to_int32(stuff->num_events * sizeof(xEvent)))
- return BadLength;
-
- eventP = (xEvent *) & stuff[1];
- for (i = 0; i < stuff->num_events; i++, eventP++) {
- proc = EventSwapVector[eventP->u.u.type & 0177];
- if (proc == NotImplemented) /* no swapping proc; invalid event type? */
- return (BadValue);
- (*proc) (eventP, &eventT);
- *eventP = eventT;
- }
-
- p = (CARD32 *)(((xEvent *) & stuff[1]) + stuff->num_events);
- SwapLongs(p, stuff->count);
- return (ProcXSendExtensionEvent(client));
-}
-
-/***********************************************************************
- *
- * Send an event to some client, as if it had come from an extension input
- * device.
- *
- */
-
-int
-ProcXSendExtensionEvent(ClientPtr client)
-{
- int ret;
- DeviceIntPtr dev;
- xEvent *first;
- XEventClass *list;
- struct tmask tmp[EMASKSIZE];
-
- REQUEST(xSendExtensionEventReq);
- REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
-
- if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
- (stuff->num_events * bytes_to_int32(sizeof(xEvent))))
- return BadLength;
-
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess);
- if (ret != Success)
- return ret;
-
- /* The client's event type must be one defined by an extension. */
-
- first = ((xEvent *) & stuff[1]);
- if (!((EXTENSION_EVENT_BASE <= first->u.u.type) &&
- (first->u.u.type < lastEvent))) {
- client->errorValue = first->u.u.type;
- return BadValue;
- }
-
- list = (XEventClass *) (first + stuff->num_events);
- if ((ret = CreateMaskFromList(client, list, stuff->count, tmp, dev,
- X_SendExtensionEvent)) != Success)
- return ret;
-
- ret = (SendEvent(client, dev, stuff->destination,
- stuff->propagate, (xEvent *) & stuff[1],
- tmp[stuff->deviceid].mask, stuff->num_events));
-
- return ret;
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/***********************************************************************
+ *
+ * Request to send an extension event.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* Window */
+#include "extnsionst.h" /* EventSwapPtr */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "exevents.h"
+#include "exglobals.h"
+
+#include "grabdev.h"
+#include "sendexev.h"
+
+extern int lastEvent; /* Defined in extension.c */
+
+/***********************************************************************
+ *
+ * Handle requests from clients with a different byte order than us.
+ *
+ */
+
+int
+SProcXSendExtensionEvent(ClientPtr client)
+{
+ char n;
+ CARD32 *p;
+ int i;
+ xEvent eventT;
+ xEvent *eventP;
+ EventSwapPtr proc;
+
+ REQUEST(xSendExtensionEventReq);
+ swaps(&stuff->length, n);
+ REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
+ swapl(&stuff->destination, n);
+ swaps(&stuff->count, n);
+
+ if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
+ bytes_to_int32(stuff->num_events * sizeof(xEvent)))
+ return BadLength;
+
+ eventP = (xEvent *) & stuff[1];
+ for (i = 0; i < stuff->num_events; i++, eventP++) {
+ proc = EventSwapVector[eventP->u.u.type & 0177];
+ if (proc == NotImplemented) /* no swapping proc; invalid event type? */
+ return BadValue;
+ (*proc) (eventP, &eventT);
+ *eventP = eventT;
+ }
+
+ p = (CARD32 *)(((xEvent *) & stuff[1]) + stuff->num_events);
+ SwapLongs(p, stuff->count);
+ return (ProcXSendExtensionEvent(client));
+}
+
+/***********************************************************************
+ *
+ * Send an event to some client, as if it had come from an extension input
+ * device.
+ *
+ */
+
+int
+ProcXSendExtensionEvent(ClientPtr client)
+{
+ int ret;
+ DeviceIntPtr dev;
+ xEvent *first;
+ XEventClass *list;
+ struct tmask tmp[EMASKSIZE];
+
+ REQUEST(xSendExtensionEventReq);
+ REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
+
+ if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
+ (stuff->num_events * bytes_to_int32(sizeof(xEvent))))
+ return BadLength;
+
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess);
+ if (ret != Success)
+ return ret;
+
+ /* The client's event type must be one defined by an extension. */
+
+ first = ((xEvent *) & stuff[1]);
+ if (!((EXTENSION_EVENT_BASE <= first->u.u.type) &&
+ (first->u.u.type < lastEvent))) {
+ client->errorValue = first->u.u.type;
+ return BadValue;
+ }
+
+ list = (XEventClass *) (first + stuff->num_events);
+ if ((ret = CreateMaskFromList(client, list, stuff->count, tmp, dev,
+ X_SendExtensionEvent)) != Success)
+ return ret;
+
+ ret = (SendEvent(client, dev, stuff->destination,
+ stuff->propagate, (xEvent *) & stuff[1],
+ tmp[stuff->deviceid].mask, stuff->num_events));
+
+ return ret;
+}
diff --git a/xorg-server/Xi/stubs.c b/xorg-server/Xi/stubs.c
index 6931b26f0..4921b36f9 100644
--- a/xorg-server/Xi/stubs.c
+++ b/xorg-server/Xi/stubs.c
@@ -207,14 +207,14 @@ ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev,
{
switch (control->control) {
case DEVICE_RESOLUTION:
- return (BadMatch);
+ return BadMatch;
case DEVICE_ABS_CALIB:
case DEVICE_ABS_AREA:
- return (BadMatch);
+ return BadMatch;
case DEVICE_CORE:
- return (BadMatch);
+ return BadMatch;
default:
- return (BadMatch);
+ return BadMatch;
}
}
diff --git a/xorg-server/Xi/xichangecursor.c b/xorg-server/Xi/xichangecursor.c
index 825f8227a..2d58fa529 100644
--- a/xorg-server/Xi/xichangecursor.c
+++ b/xorg-server/Xi/xichangecursor.c
@@ -93,7 +93,7 @@ int ProcXIChangeCursor(ClientPtr client)
if (stuff->cursor == None)
{
- if (pWin == WindowTable[pWin->drawable.pScreen->myNum])
+ if (pWin == pWin->drawable.pScreen->root)
pCursor = rootCursor;
else
pCursor = (CursorPtr)None;
diff --git a/xorg-server/Xi/xiproperty.c b/xorg-server/Xi/xiproperty.c
index 4f8d2430d..11739f9ae 100644
--- a/xorg-server/Xi/xiproperty.c
+++ b/xorg-server/Xi/xiproperty.c
@@ -177,7 +177,9 @@ static struct dev_properties
{0, BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP},
{0, BTN_LABEL_PROP_BTN_GEAR_DOWN},
- {0, BTN_LABEL_PROP_BTN_GEAR_UP}
+ {0, BTN_LABEL_PROP_BTN_GEAR_UP},
+
+ {0, XI_PROP_TRANSFORM}
};
static long XIPropHandlerID = 1;
@@ -252,18 +254,18 @@ get_property(ClientPtr client, DeviceIntPtr dev, Atom property, Atom type,
if (!ValidAtom(property))
{
client->errorValue = property;
- return(BadAtom);
+ return BadAtom;
}
if ((delete != xTrue) && (delete != xFalse))
{
client->errorValue = delete;
- return(BadValue);
+ return BadValue;
}
if ((type != AnyPropertyType) && !ValidAtom(type))
{
client->errorValue = type;
- return(BadAtom);
+ return BadAtom;
}
for (prop = dev->properties.properties; prop; prop = prop->next)
@@ -348,12 +350,12 @@ check_change_property(ClientPtr client, Atom property, Atom type, int format,
if (!ValidAtom(property))
{
client->errorValue = property;
- return(BadAtom);
+ return BadAtom;
}
if (!ValidAtom(type))
{
client->errorValue = type;
- return(BadAtom);
+ return BadAtom;
}
return Success;
@@ -620,8 +622,7 @@ XIFetchDeviceProperty(DeviceIntPtr dev, Atom property)
static void
XIDestroyDeviceProperty (XIPropertyPtr prop)
{
- if (prop->value.data)
- free(prop->value.data);
+ free(prop->value.data);
free(prop);
}
@@ -682,7 +683,7 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient)
if (handler->DeleteProperty)
rc = handler->DeleteProperty(device, prop->propertyName);
if (rc != Success)
- return (rc);
+ return rc;
handler = handler->next;
}
}
@@ -719,7 +720,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
{
prop = XICreateDeviceProperty (property);
if (!prop)
- return(BadAlloc);
+ return BadAlloc;
add = TRUE;
mode = PropModeReplace;
}
@@ -731,9 +732,9 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
"PropModeReplace" since they will be written over. */
if ((format != prop_value->format) && (mode != PropModeReplace))
- return(BadMatch);
+ return BadMatch;
if ((prop_value->type != type) && (mode != PropModeReplace))
- return(BadMatch);
+ return BadMatch;
new_value = *prop_value;
if (mode == PropModeReplace)
total_len = len;
@@ -796,9 +797,8 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
&new_value, checkonly);
if (checkonly && rc != Success)
{
- if (new_value.data)
- free(new_value.data);
- return (rc);
+ free(new_value.data);
+ return rc;
}
}
handler = handler->next;
@@ -806,8 +806,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
checkonly = !checkonly;
} while (!checkonly);
}
- if (prop_value->data)
- free(prop_value->data);
+ free(prop_value->data);
*prop_value = new_value;
} else if (len == 0)
{
@@ -824,7 +823,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
send_property_event(dev, prop->propertyName,
(add) ? XIPropertyCreated : XIPropertyModified);
- return(Success);
+ return Success;
}
int
@@ -957,7 +956,7 @@ ProcXDeleteDeviceProperty (ClientPtr client)
if (!ValidAtom(stuff->property))
{
client->errorValue = stuff->property;
- return (BadAtom);
+ return BadAtom;
}
rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE);
@@ -1200,7 +1199,7 @@ ProcXIDeleteProperty(ClientPtr client)
if (!ValidAtom(stuff->property))
{
client->errorValue = stuff->property;
- return (BadAtom);
+ return BadAtom;
}
rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE);
diff --git a/xorg-server/Xi/xiquerypointer.c b/xorg-server/Xi/xiquerypointer.c
index a5855bef3..0c6079d23 100644
--- a/xorg-server/Xi/xiquerypointer.c
+++ b/xorg-server/Xi/xiquerypointer.c
@@ -43,6 +43,7 @@
#include "exevents.h"
#include "exglobals.h"
#include "eventconvert.h"
+#include "scrnintstr.h"
#include "xkbsrv.h"
#ifdef PANORAMIX
@@ -181,12 +182,12 @@ ProcXIQueryPointer(ClientPtr client)
#ifdef PANORAMIX
if(!noPanoramiXExtension) {
- rep.root_x += FP1616(panoramiXdataPtr[0].x, 0);
- rep.root_y += FP1616(panoramiXdataPtr[0].y, 0);
+ rep.root_x += FP1616(screenInfo.screens[0]->x, 0);
+ rep.root_y += FP1616(screenInfo.screens[0]->y, 0);
if (stuff->win == rep.root)
{
- rep.win_x += FP1616(panoramiXdataPtr[0].x, 0);
- rep.win_y += FP1616(panoramiXdataPtr[0].y, 0);
+ rep.win_x += FP1616(screenInfo.screens[0]->x, 0);
+ rep.win_y += FP1616(screenInfo.screens[0]->y, 0);
}
}
#endif