summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <Sam@XPS-SUSE.site>2008-11-01 13:31:45 +0900
committerSam Spilsbury <Sam@XPS-SUSE.site>2008-11-01 13:31:45 +0900
commit02521a6331a5f086a274af4052a0c24c3ccd6149 (patch)
tree6341f96f704474815d967c36621f7eee7cc0c1db
parent9aded55e131628f7d5227894b4b12d93140fedd0 (diff)
downloadcompiz-mpx-ir-02521a6331a5f086a274af4052a0c24c3ccd6149.tar.gz
compiz-mpx-ir-02521a6331a5f086a274af4052a0c24c3ccd6149.tar.bz2
Add Xorg Input Redirection Patches
-rw-r--r--xorg/compositeproto/0001-Add-Interface-for-applications-to-set-triangular-co.patch62
-rw-r--r--xorg/libXcomposite/0001-Add-Interface-for-applications-to-set-a-triangular-c.patch139
-rw-r--r--xorg/xserver/0001-XTriangle-Input-Mesh-Redirection-Support.patch710
-rw-r--r--xorg/xserver/0002-Proprietary-Driver-Workarounds.patch395
4 files changed, 1306 insertions, 0 deletions
diff --git a/xorg/compositeproto/0001-Add-Interface-for-applications-to-set-triangular-co.patch b/xorg/compositeproto/0001-Add-Interface-for-applications-to-set-triangular-co.patch
new file mode 100644
index 0000000..ed8f2ea
--- /dev/null
+++ b/xorg/compositeproto/0001-Add-Interface-for-applications-to-set-triangular-co.patch
@@ -0,0 +1,62 @@
+From 96d28a97b42f0b8764ed8dc912e05b406294f309 Mon Sep 17 00:00:00 2001
+From: Sam Spilsbury <Sam@XPS-SUSE.site>
+Date: Sat, 1 Nov 2008 13:18:51 +0900
+Subject: [PATCH] Add Interface for applications to set triangular-co-ordinate mesh
+
+---
+ composite.h | 3 ++-
+ compositeproto.h | 9 +++++++++
+ configure.ac | 2 +-
+ 3 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/composite.h b/composite.h
+index 30b190f..eb1efba 100644
+--- a/composite.h
++++ b/composite.h
+@@ -63,8 +63,9 @@
+ #define X_CompositeNameWindowPixmap 6
+ #define X_CompositeGetOverlayWindow 7
+ #define X_CompositeReleaseOverlayWindow 8
++#define X_CompositeSetTriangularCoordinateMesh 9
+
+-#define CompositeNumberRequests (X_CompositeReleaseOverlayWindow + 1)
++#define CompositeNumberRequests (X_CompositeSetTriangularCoordinateMesh + 1)
+
+ #define CompositeNumberEvents 0
+
+diff --git a/compositeproto.h b/compositeproto.h
+index 2e392e2..11ee29c 100644
+--- a/compositeproto.h
++++ b/compositeproto.h
+@@ -186,6 +186,15 @@ typedef struct {
+
+ #define sz_xCompositeReleaseOverlayWindowReq sizeof(xCompositeReleaseOverlayWindowReq)
+
++typedef struct {
++ CARD8 reqType;
++ CARD8 compositeReqType;
++ CARD16 length;
++ Window window B32;
++} xCompositeSetTriangularCoordinateMeshReq;
++
++#define sz_xCompositeSetTriangularCoordinateMeshReq 8
++
+ #undef Window
+ #undef Region
+ #undef Pixmap
+diff --git a/configure.ac b/configure.ac
+index 3a5fc5e..85acb1d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -24,7 +24,7 @@ dnl
+ dnl Process this file with autoconf to create configure.
+
+ AC_PREREQ([2.57])
+-AC_INIT([CompositeProto], [0.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
++AC_INIT([CompositeProto], [0.5], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+ AM_INIT_AUTOMAKE([foreign dist-bzip2])
+ AM_MAINTAINER_MODE
+
+--
+1.5.6
+
diff --git a/xorg/libXcomposite/0001-Add-Interface-for-applications-to-set-a-triangular-c.patch b/xorg/libXcomposite/0001-Add-Interface-for-applications-to-set-a-triangular-c.patch
new file mode 100644
index 0000000..fa88af9
--- /dev/null
+++ b/xorg/libXcomposite/0001-Add-Interface-for-applications-to-set-a-triangular-c.patch
@@ -0,0 +1,139 @@
+From b66ad409b4e8eaaff8bbd411b966e6c7678f2349 Mon Sep 17 00:00:00 2001
+From: Sam Spilsbury <Sam@XPS-SUSE.site>
+Date: Sat, 1 Nov 2008 13:17:33 +0900
+Subject: [PATCH] Add Interface for applications to set a triangular-co-ordinate mesh
+
+---
+ configure.ac | 4 +-
+ include/X11/extensions/Xcomposite.h | 7 ++++++
+ src/Xcomposite.c | 39 +++++++++++++++++++++++++++++++++++
+ src/xcompositeint.h | 14 ++++++++++++
+ 4 files changed, 62 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5cf5f74..bc7900b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -32,7 +32,7 @@ dnl protocol, so Xcomposite version l.n.m corresponds to protocol version l.n
+ dnl that 'revision' number appears in Xcomposite.h and has to be manually
+ dnl synchronized.
+ dnl
+-AC_INIT(libXcomposite, 0.4.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXcomposite)
++AC_INIT(libXcomposite, 0.5.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXcomposite)
+ AM_INIT_AUTOMAKE([dist-bzip2])
+ AM_MAINTAINER_MODE
+
+@@ -57,7 +57,7 @@ if test "$VERSION" = "" ; then
+ fi
+ COMPOSITEEXT_VERSION=[`echo $VERSION | sed 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`]
+ AC_SUBST(COMPOSITEEXT_VERSION)
+-PKG_CHECK_MODULES(XCOMPOSITE, [compositeproto >= $COMPOSITEEXT_VERSION] x11 xfixes xext fixesproto)
++PKG_CHECK_MODULES(XCOMPOSITE, [compositeproto >= $COMPOSITEEXT_VERSION] x11 xfixes xext fixesproto xrender renderproto)
+ AC_SUBST(XCOMPOSITE_CFLAGS)
+ AC_SUBST(XCOMPOSITE_LIBS)
+
+diff --git a/include/X11/extensions/Xcomposite.h b/include/X11/extensions/Xcomposite.h
+index b97e390..a6a70c5 100644
+--- a/include/X11/extensions/Xcomposite.h
++++ b/include/X11/extensions/Xcomposite.h
+@@ -45,6 +45,7 @@
+
+ #include <X11/extensions/composite.h>
+ #include <X11/extensions/Xfixes.h>
++#include <X11/extensions/Xrender.h>
+ #include <X11/Xfuncproto.h>
+
+ /*
+@@ -92,6 +93,12 @@ XCompositeGetOverlayWindow (Display *dpy, Window window);
+ void
+ XCompositeReleaseOverlayWindow (Display *dpy, Window window);
+
++void
++XCompositeSetTriangularCoordinateMesh (Display *dpy,
++ Window window,
++ _Xconst XTriangle *triangle,
++ int nTriangle);
++
+ _XFUNCPROTOEND
+
+ #endif /* _XCOMPOSITE_H_ */
+diff --git a/src/Xcomposite.c b/src/Xcomposite.c
+index 33b5727..954a183 100644
+--- a/src/Xcomposite.c
++++ b/src/Xcomposite.c
+@@ -393,3 +393,42 @@ XCompositeReleaseOverlayWindow (Display *dpy, Window window)
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ }
++
++
++void
++XCompositeSetTriangularCoordinateMesh (Display *dpy,
++ Window window,
++ _Xconst XTriangle *triangle,
++ int nTriangle)
++{
++ XCompositeExtDisplayInfo *info = XCompositeFindDisplay (dpy);
++ xCompositeSetTriangularCoordinateMeshReq *req;
++ int n;
++ long len;
++
++ XCompositeSimpleCheckExtension (dpy, info);
++ LockDisplay (dpy);
++ while (nTriangle)
++ {
++ GetReq (CompositeSetTriangularCoordinateMesh, req);
++ req->reqType = info->codes->major_opcode;
++ req->compositeReqType = X_CompositeSetTriangularCoordinateMesh;
++ req->window = window;
++ n = nTriangle;
++ len = ((long) n) * (SIZEOF (xTriangle) >> 2);
++ if (!dpy->bigreq_size && len > (dpy->max_request_size - req->length))
++ {
++ n = (dpy->max_request_size - req->length) /
++ (SIZEOF (xTriangle) >> 2);
++ len = ((long) n) * (SIZEOF (xTriangle) >> 2);
++ }
++ SetReqLen (req, len, len);
++ len <<= 2;
++ DataInt32 (dpy, (int *) triangle, len);
++ nTriangle -= n;
++ triangle += n;
++ }
++ UnlockDisplay (dpy);
++ SyncHandle ();
++}
++
+diff --git a/src/xcompositeint.h b/src/xcompositeint.h
+index 7f0f868..4af645c 100644
+--- a/src/xcompositeint.h
++++ b/src/xcompositeint.h
+@@ -49,6 +49,7 @@
+ #include <X11/Xlib.h>
+ #include <X11/Xlibint.h>
+ #include <X11/Xutil.h>
++#include <X11/extensions/renderproto.h>
+ #include <X11/extensions/compositeproto.h>
+ #include <X11/extensions/Xcomposite.h>
+
+@@ -81,4 +82,17 @@ XCompositeFindDisplay (Display *dpy);
+ #define XCompositeSimpleCheckExtension(dpy,i) \
+ if (!XCompositeHasExtension(i)) { return; }
+
++
++/*
++ * Xlib uses long for 32-bit values. Xcomposite uses int. This
++ * matters on alpha. Note that this macro assumes that int is 32 bits
++ * except on WORD64 machines where it is 64 bits.
++ */
++
++#ifdef WORD64
++#define DataInt32(dpy,d,len) Data32(dpy,(long *) (d),len)
++#else
++#define DataInt32(dpy,d,len) Data(dpy,(char *) (d),len)
++#endif
++
+ #endif /* _XCOMPOSITEINT_H_ */
+--
+1.5.6
+
diff --git a/xorg/xserver/0001-XTriangle-Input-Mesh-Redirection-Support.patch b/xorg/xserver/0001-XTriangle-Input-Mesh-Redirection-Support.patch
new file mode 100644
index 0000000..d5c55fc
--- /dev/null
+++ b/xorg/xserver/0001-XTriangle-Input-Mesh-Redirection-Support.patch
@@ -0,0 +1,710 @@
+From 272d720f5c423bca1b59fceb92998223c986da92 Mon Sep 17 00:00:00 2001
+From: Sam Spilsbury <Sam@XPS-SUSE.site>
+Date: Sat, 1 Nov 2008 12:58:04 +0900
+Subject: [PATCH] XTriangle Input Mesh Redirection Support
+
+---
+ composite/compalloc.c | 1 +
+ composite/compint.h | 51 +++++++
+ composite/compwindow.c | 345 ++++++++++++++++++++++++++++++++++++++++++++++++
+ dix/events.c | 155 +++++++++++++++++++++-
+ 4 files changed, 545 insertions(+), 7 deletions(-)
+
+diff --git a/composite/compalloc.c b/composite/compalloc.c
+index a2f3f14..ddfefe0 100644
+--- a/composite/compalloc.c
++++ b/composite/compalloc.c
+@@ -140,6 +140,7 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
+ cw->oldy = COMP_ORIGIN_INVALID;
+ cw->damageRegistered = FALSE;
+ cw->damaged = FALSE;
++ cw->pInputMesh = NULL;
+ dixSetPrivate(&pWin->devPrivates, CompWindowPrivateKey, cw);
+ }
+ ccw->next = cw->clients;
+diff --git a/composite/compint.h b/composite/compint.h
+index 1c19ccd..6ff4c9c 100644
+--- a/composite/compint.h
++++ b/composite/compint.h
+@@ -84,6 +84,21 @@ typedef struct _CompClientWindow {
+ int update;
+ } CompClientWindowRec, *CompClientWindowPtr;
+
++typedef struct _CompTriangle {
++ xTriangle tri;
++ xFixed_48_16 area;
++} CompTriangle;
++
++typedef struct _CompTriangleMap {
++ CompTriangle parent;
++ CompTriangle child;
++} CompTriangleMap;
++
++typedef struct _CompTriangularMesh {
++ CompTriangleMap *map;
++ int nMap;
++} CompTriangularMeshRec, *CompTriangularMeshPtr;
++
+ typedef struct _CompWindow {
+ RegionRec borderClip;
+ DamagePtr damage; /* for automatic update mode */
+@@ -95,6 +110,7 @@ typedef struct _CompWindow {
+ int oldy;
+ PixmapPtr pOldPixmap;
+ int borderClipX, borderClipY;
++ CompTriangularMeshPtr pInputMesh;
+ } CompWindowRec, *CompWindowPtr;
+
+ #define COMP_ORIGIN_INVALID 0x80000000
+@@ -319,4 +335,39 @@ CompositeRealChildHead (WindowPtr pWin);
+ int
+ DeleteWindowNoInputDevices(pointer value, XID wid);
+
++Bool
++CompositeXYParentToChild (WindowPtr pChild,
++ int parentX,
++ int parentY,
++ int *childX,
++ int *childY);
++
++Bool
++CompositeXYChildToParent (WindowPtr pChild,
++ int childX,
++ int childY,
++ int *parentX,
++ int *parentY);
++
++void
++CompositeXYScreenToWindowRootCoordinate (WindowPtr pWin,
++ int x,
++ int y,
++ int *rootX,
++ int *rootY);
++
++void
++CompositeXYScreenFromWindowRootCoordinate (WindowPtr pWin,
++ int x,
++ int y,
++ int *screenX,
++ int *screenY);
++
++int
++CompositeSetTriangularCoordinateMesh (ClientPtr pClient,
++ WindowPtr pWin,
++ int n,
++ xTriangle *tri);
++
++
+ #endif /* _COMPINT_H_ */
+diff --git a/composite/compwindow.c b/composite/compwindow.c
+index 577fa73..6b98c58 100644
+--- a/composite/compwindow.c
++++ b/composite/compwindow.c
+@@ -45,6 +45,7 @@
+ #endif
+
+ #include "compint.h"
++//#include "inputstr.h"
+
+ #ifdef COMPOSITE_DEBUG
+ static int
+@@ -821,3 +822,347 @@ CompositeRealChildHead (WindowPtr pWin)
+ return pChildBefore;
+ }
+ }
++
++
++static int
++Orientation (xPointFixed *v1,
++ xPointFixed *v2,
++ xPointFixed *p)
++{
++ xFixed_48_16 a, b, c;
++
++ a = (xFixed_48_16) (v2->x - v1->x) * (p->y - v1->y);
++ b = (xFixed_48_16) (p->x - v1->x) * (v2->y - v1->y);
++
++ c = a - b;
++
++ return (c > 0) ? 1 : (c < 0) ? -1 : 0;
++}
++
++static Bool
++PointInTriangle (xTriangle *triangle,
++ xPointFixed *p)
++{
++ int o1, o2, o3;
++
++ o1 = Orientation (&triangle->p1, &triangle->p2, p);
++ o2 = Orientation (&triangle->p2, &triangle->p3, p);
++ o3 = Orientation (&triangle->p3, &triangle->p1, p);
++
++ /*
++ * 0 orientation means point is on the edge and we allow that as it is
++ * better that two triangles with coincident edges overlap than that
++ * there is a gap between them.
++ */
++ if (o2 == 0)
++ o2 = o3;
++ if (o1 == 0)
++ o1 = o2;
++
++ /*
++ * Point is in triangle if edge orientation relative to opposite point is
++ * the same for all edges.
++ */
++ return (o1 == o2) && (o2 == o3);
++}
++
++static Bool
++XYInTriangle (xTriangle *triangle,
++ int x,
++ int y)
++{
++ xPointFixed p;
++
++ p.x = IntToxFixed (x);
++ p.y = IntToxFixed (y);
++
++ return PointInTriangle (triangle, &p);
++}
++
++static xFixed_48_16
++TriangleArea (xPointFixed *p1,
++ xPointFixed *p2,
++ xPointFixed *p3)
++{
++ return (((xFixed_48_16) p3->x - p2->x) *
++ ((xFixed_48_16) p3->y - p1->y) -
++ ((xFixed_48_16) p3->y - p2->y) *
++ ((xFixed_48_16) p3->x - p1->x)) >> 16;
++}
++
++/*
++ * Inverse mapping of point P located in triangle.
++ */
++static void
++MapPoint (CompTriangle *from,
++ CompTriangle *to,
++ xPointFixed *p,
++ xPointFixed *result)
++{
++ xFixed_48_16 u, v, w;
++ xFixed_48_16 x, y;
++
++ u = (TriangleArea (&from->tri.p1, &from->tri.p2, p) << 16) / from->area;
++ v = (TriangleArea (&from->tri.p3, &from->tri.p1, p) << 16) / from->area;
++ w = (TriangleArea (&from->tri.p2, &from->tri.p3, p) << 16) / from->area;
++
++ x = to->tri.p3.x * u + to->tri.p2.x * v + to->tri.p1.x * w;
++ y = to->tri.p3.y * u + to->tri.p2.y * v + to->tri.p1.y * w;
++
++ result->x = x >> 16;
++ result->y = y >> 16;
++}
++
++static void
++XYMapPoint (CompTriangle *from,
++ CompTriangle *to,
++ int fromX,
++ int fromY,
++ int *toX,
++ int *toY)
++{
++ xPointFixed in, out;
++
++ in.x = IntToxFixed (fromX);
++ in.y = IntToxFixed (fromY);
++
++ MapPoint (from, to, &in, &out);
++
++ *toX = xFixedToInt (out.x + xFixed1 / 2);
++ *toY = xFixedToInt (out.y + xFixed1 / 2);
++}
++
++Bool
++CompositeXYParentToChild (WindowPtr pChild,
++ int parentX,
++ int parentY,
++ int *childX,
++ int *childY)
++{
++ CompWindowPtr cw = GetCompWindow (pChild);
++
++ if (cw && cw->pInputMesh)
++ {
++ CompTriangleMap *map = cw->pInputMesh->map;
++ int nMap = cw->pInputMesh->nMap;
++
++ while (nMap--)
++ {
++ if (!map->parent.area)
++ continue;
++
++ if (XYInTriangle (&map->parent.tri, parentX, parentY))
++ {
++ XYMapPoint (&map->parent, &map->child,
++ parentX, parentY,
++ childX, childY);
++ /* Credit to Joel Bosveld for this little bit,
++ * it is a hack, but it fixes the problem where
++ * the mesh could only end up in the top left corner
++ */
++ *childX += pChild->drawable.x;
++ *childY += pChild->drawable.y;
++
++ /* There is a mesh and the point was redirected,
++ * handle as normal
++ */
++ return TRUE;
++ }
++
++ map++;
++ }
++ }
++
++ *childX = parentX;
++ *childY = parentY;
++
++ /* There is a mesh, but nothing was redirected,
++ * don't process the event on the non-redirected
++ * window
++ */
++ if (cw && cw->pInputMesh)
++ return FALSE;
++
++ /* There is no mesh, handle events like normal */
++ if (!cw || !cw->pInputMesh)
++ return TRUE;
++}
++
++Bool
++CompositeXYChildToParent (WindowPtr pChild,
++ int childX,
++ int childY,
++ int *parentX,
++ int *parentY)
++{
++ CompWindowPtr cw = GetCompWindow (pChild);
++
++ if (cw && cw->pInputMesh)
++ {
++ CompTriangleMap *map = cw->pInputMesh->map;
++ int nMap = cw->pInputMesh->nMap;
++
++ while (nMap--)
++ {
++ if (!map->child.area)
++ continue;
++
++ if (XYInTriangle (&map->child.tri, childX, childY))
++ {
++ XYMapPoint (&map->child, &map->parent,
++ childX, childY,
++ parentX, parentY);
++
++ /* There is a mesh and the point was redirected,
++ * handle as normal
++ */
++ return TRUE;
++ }
++
++ map++;
++ }
++ }
++
++ *parentX = childX;
++ *parentY = childY;
++
++ /* There is a mesh, but nothing was redirected,
++ * don't process the event on the non-redirected
++ * window
++ */
++ if (cw && cw->pInputMesh)
++ return FALSE;
++
++ /* There is no mesh, handle events like normal */
++ if (!cw || !cw->pInputMesh)
++ return TRUE;
++}
++
++void
++CompositeXYScreenToWindowRootCoordinate (WindowPtr pWin,
++ int x,
++ int y,
++ int *rootX,
++ int *rootY)
++{
++ if (!pWin->parent)
++ {
++ *rootX = x;
++ *rootY = y;
++ }
++ else
++ {
++ CompositeXYScreenToWindowRootCoordinate (pWin->parent, x, y, &x, &y);
++ CompositeXYParentToChild (pWin, x, y, rootX, rootY);
++ }
++}
++
++void
++CompositeXYScreenFromWindowRootCoordinate (WindowPtr pWin,
++ int x,
++ int y,
++ int *screenX,
++ int *screenY)
++{
++ if (!pWin->parent)
++ {
++ *screenX = x;
++ *screenY = y;
++ }
++ else
++ {
++ CompositeXYChildToParent (pWin, x, y, &x, &y);
++ CompositeXYScreenFromWindowRootCoordinate (pWin->parent,
++ x, y, screenX, screenY);
++ }
++}
++
++int
++CompositeSetTriangularCoordinateMesh (ClientPtr pClient,
++ WindowPtr pWin,
++ int n,
++ xTriangle *tri)
++{
++ CompSubwindowsPtr csw = GetCompSubwindows (pWin->parent);
++ CompWindowPtr cw = GetCompWindow (pWin);
++ CompClientWindowPtr ccw;
++ WindowPtr pSpriteWin;
++
++ /*
++ * sub-window must be Manual update
++ */
++ if (!csw || csw->update != CompositeRedirectManual)
++ return BadAccess;
++
++ /*
++ * must be Manual update client
++ */
++ for (ccw = csw->clients; ccw; ccw = ccw->next)
++ if (ccw->update == CompositeRedirectManual &&
++ CLIENT_ID (ccw->id) != pClient->index)
++ return BadAccess;
++
++ if (n)
++ {
++ CompTriangularMeshPtr mesh;
++ int i;
++
++ mesh = xalloc (sizeof (CompTriangularMeshRec) +
++ sizeof (CompTriangleMap) * n / 2);
++ if (!mesh)
++ return FALSE;
++
++ mesh->map = (CompTriangleMap *) (mesh + 1);
++ mesh->nMap = n / 2;
++
++ for (i = 0; i < n; i += 2)
++ {
++ mesh->map[i / 2].parent.tri = tri[i];
++ mesh->map[i / 2].parent.area =
++ TriangleArea (&tri[i].p1, &tri[i].p2, &tri[i].p3);
++
++ mesh->map[i / 2].child.tri = tri[i + 1];
++ mesh->map[i / 2].child.area =
++ TriangleArea (&tri[i + 1].p1, &tri[i + 1].p2, &tri[i + 1].p3);
++ }
++
++ if (cw->pInputMesh)
++ xfree (cw->pInputMesh);
++
++ cw->pInputMesh = mesh;
++ }
++ else
++ {
++ if (cw->pInputMesh)
++ {
++ xfree (cw->pInputMesh);
++ cw->pInputMesh = NULL;
++ }
++ }
++
++ /*pSpriteWin = GetSpriteWindow (inputInfo.devices);
++ while (pSpriteWin)
++ {
++ if (pSpriteWin == pWin->parent)
++ {
++ xEvent xE;
++ int x, y;
++
++ GetSpritePosition (inputInfo.devices, &x, &y);
++
++ xE.u.keyButtonPointer.rootX = x;
++ xE.u.keyButtonPointer.rootY = y;
++ xE.u.keyButtonPointer.time = currentTime.milliseconds;
++ xE.u.u.type = MotionNotify;
++
++ (*inputInfo.pointer->public.processInputProc) (&xE,
++ inputInfo.pointer,
++ 1);
++ break;
++ }
++
++ pSpriteWin = pSpriteWin->parent;
++ }*/
++
++ return 0;
++}
+diff --git a/dix/events.c b/dix/events.c
+index 6833a6b..05fce0d 100644
+--- a/dix/events.c
++++ b/dix/events.c
+@@ -133,6 +133,7 @@ of the copyright holder.
+ #include "panoramiX.h"
+ #include "panoramiXsrv.h"
+ #endif
++#include "compint.h"
+ #include "globals.h"
+
+ #ifdef XKB
+@@ -1953,6 +1954,7 @@ ReleaseActiveGrabs(ClientPtr client)
+ * @return 1 if event was delivered, 0 if not or -1 if grab was not set by the
+ * client.
+ */
++
+ _X_EXPORT int
+ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
+ int count, Mask mask, Mask filter, GrabPtr grab)
+@@ -2027,6 +2029,7 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
+ }
+ }
+
++
+ /**
+ * Deliver events to a window. At this point, we do not yet know if the event
+ * actually needs to be delivered. May activate a grab if the event is a
+@@ -2592,18 +2595,46 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
+ * @returns the window at the given coordinates.
+ */
+ static WindowPtr
+-XYToWindow(DeviceIntPtr pDev, int x, int y)
++XYToWindow(DeviceIntPtr pDev, int rootX, int rootY)
+ {
+ WindowPtr pWin;
+ BoxRec box;
++ int x, y;
+ SpritePtr pSprite;
++ Bool handle = TRUE;
+
+ pSprite = pDev->spriteInfo->sprite;
+ pSprite->spriteTraceGood = 1; /* root window still there */
+ pWin = RootWindow(pDev)->firstChild;
+ while (pWin)
+ {
+- if ((pWin->mapped) &&
++ x = rootX;
++ y = rootY;
++
++#ifdef COMPOSITE
++ /*
++ * Transform from parent to child.
++ */
++ if (pWin->mapped)
++ {
++ if (pWin->parent)
++ {
++ x = rootX - pWin->parent->drawable.x;
++ y = rootY - pWin->parent->drawable.y;
++ }
++
++ handle = CompositeXYParentToChild (pWin, x, y, &x, &y);
++
++ if (pWin->parent)
++ {
++ x += pWin->parent->drawable.x;
++ y += pWin->parent->drawable.y;
++ }
++ }
++#endif
++
++
++ if ((pWin->mapped) && (handle) &&
+ (x >= pWin->drawable.x - wBorderWidth (pWin)) &&
+ (x < pWin->drawable.x + (int)pWin->drawable.width +
+ wBorderWidth(pWin)) &&
+@@ -2636,6 +2667,8 @@ XYToWindow(DeviceIntPtr pDev, int x, int y)
+ pSprite->spriteTraceSize*sizeof(WindowPtr));
+ }
+ pSprite->spriteTrace[pSprite->spriteTraceGood++] = pWin;
++ rootX = x;
++ rootY = y;
+ pWin = pWin->firstChild;
+ }
+ else
+@@ -3670,7 +3703,7 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
+ deliveries = DeliverDeviceEvents(pSprite->win, xE, grab, focus,
+ thisDev, count);
+ else if (focus)
+- deliveries = DeliverDeviceEvents(focus, xE, grab, focus,
++ deliveries = DeliverDeviceEvents(pSprite->win, xE, grab, focus,
+ thisDev, count);
+ }
+ if (!deliveries)
+@@ -5377,6 +5410,7 @@ ProcQueryPointer(ClientPtr client)
+ DeviceIntPtr mouse = PickPointer(client);
+ SpritePtr pSprite;
+ int rc;
++ int rootX, rootY;
+ REQUEST(xResourceReq);
+ REQUEST_SIZE_MATCH(xResourceReq);
+
+@@ -5395,14 +5429,30 @@ ProcQueryPointer(ClientPtr client)
+ rep.mask = mouse->button->state | inputInfo.keyboard->key->state;
+ rep.length = 0;
+ rep.root = (RootWindow(mouse))->drawable.id;
+- rep.rootX = pSprite->hot.x;
+- rep.rootY = pSprite->hot.y;
++ //rep.rootX = pSprite->hot.x;
++ //rep.rootY = pSprite->hot.y;
+ rep.child = None;
++
++#ifdef COMPOSITE
++ /*
++ * Return coordinates in windows root coordinate space.
++ */
++ CompositeXYScreenToWindowRootCoordinate (pWin,
++ pSprite->hot.x, pSprite->hot.y,
++ &rootX, &rootY);
++ rep.rootX = rootX;
++ rep.rootY = rootY;
++#else
++ rep.rootX = rootX = pSprite->hot.x;
++ rep.rootY = rootY = pSprite->hot.y;
++#endif
++
++
+ if (pSprite->hot.pScreen == pWin->drawable.pScreen)
+ {
+ rep.sameScreen = xTrue;
+- rep.winX = pSprite->hot.x - pWin->drawable.x;
+- rep.winY = pSprite->hot.y - pWin->drawable.y;
++ rep.winX = rootX - pWin->drawable.x;
++ rep.winY = rootY - pWin->drawable.y;
+ for (t = pSprite->win; t; t = t->parent)
+ if (t->parent == pWin)
+ {
+@@ -6067,12 +6117,97 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
+ xEvent *eventTo, *eventFrom;
+ int i,
+ eventlength = sizeof(xEvent);
++#ifdef COMPOSITE
++ xEvent stackCopy;
++ xEvent *compEventCopy = &stackCopy;
++#endif
+
+ #ifdef XKB
+ if ((!noXkbExtension)&&(!XkbFilterEvents(pClient, count, events)))
+ return;
+ #endif
+
++#ifdef COMPOSITE
++Bool Must_have_memory;
++ if (count > 1)
++ {
++ Must_have_memory = TRUE; /* XXX */
++ compEventCopy = xalloc (count * sizeof (xEvent));
++ Must_have_memory = FALSE; /* XXX */
++ }
++
++ memcpy (compEventCopy, events, count * sizeof (xEvent));
++ events = compEventCopy;
++
++ for (i = 0; i < count; i++)
++ {
++ deviceKeyButtonPointer *deviceEvent;
++ WindowPtr pWin;
++ int x, y, dx, dy;
++
++ switch (events[i].u.u.type) {
++ case MotionNotify:
++ case ButtonPress:
++ case ButtonRelease:
++ case KeyPress:
++ case KeyRelease:
++ case EnterNotify:
++ case LeaveNotify:
++ pWin = LookupIDByType (events[i].u.keyButtonPointer.event,
++ RT_WINDOW);
++ if (pWin)
++ {
++ x = events[i].u.keyButtonPointer.rootX;
++ y = events[i].u.keyButtonPointer.rootY;
++
++ /*
++ * rootX and rootY are in screen coordinate space.
++ * Transform to windows root coordinate space before writing
++ * events to client.
++ */
++ CompositeXYScreenToWindowRootCoordinate (pWin, x, y, &x, &y);
++
++ dx = x - events[i].u.keyButtonPointer.rootX;
++ dy = y - events[i].u.keyButtonPointer.rootY;
++
++ events[i].u.keyButtonPointer.rootX += dx;
++ events[i].u.keyButtonPointer.rootY += dy;
++ events[i].u.keyButtonPointer.eventX += dx;
++ events[i].u.keyButtonPointer.eventY += dy;
++ }
++ break;
++ default:
++ if (events[i].u.u.type == DeviceMotionNotify ||
++ events[i].u.u.type == DeviceButtonPress ||
++ events[i].u.u.type == DeviceButtonRelease ||
++ events[i].u.u.type == DeviceKeyPress ||
++ events[i].u.u.type == DeviceKeyRelease)
++ {
++ deviceEvent = (deviceKeyButtonPointer *) &events[i];
++
++ pWin = LookupIDByType (deviceEvent->event, RT_WINDOW);
++ if (pWin)
++ {
++ x = deviceEvent->root_x;
++ y = deviceEvent->root_y;
++
++ CompositeXYScreenToWindowRootCoordinate (pWin, x, y,
++ &x, &y);
++
++ dx = x - deviceEvent->root_x;
++ dy = y - deviceEvent->root_y;
++
++ deviceEvent->root_x += dx;
++ deviceEvent->root_y += dy;
++ deviceEvent->event_x += dx;
++ deviceEvent->event_y += dy;
++ }
++ }
++ break;
++ }
++ }
++#endif
++
+ #ifdef PANORAMIX
+ if(!noPanoramiXExtension &&
+ (panoramiXdataPtr[0].x || panoramiXdataPtr[0].y))
+@@ -6172,6 +6307,12 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
+ * matter. And we're all set. Woohoo. */
+ (void)WriteToClient(pClient, count * eventlength, (char *) events);
+ }
++
++#ifdef COMPOSITE
++ if (compEventCopy != &stackCopy)
++ xfree (compEventCopy);
++#endif
++
+ }
+
+ /*
+--
+1.5.6
+
diff --git a/xorg/xserver/0002-Proprietary-Driver-Workarounds.patch b/xorg/xserver/0002-Proprietary-Driver-Workarounds.patch
new file mode 100644
index 0000000..4ff1bab
--- /dev/null
+++ b/xorg/xserver/0002-Proprietary-Driver-Workarounds.patch
@@ -0,0 +1,395 @@
+From 3249e465ea25fd14f6a6e845210d224bd27ac48b Mon Sep 17 00:00:00 2001
+From: Sam Spilsbury <Sam@XPS-SUSE.site>
+Date: Sat, 1 Nov 2008 13:15:05 +0900
+Subject: [PATCH] Proprietary Driver Workarounds
+
+---
+ Xext/xvmain.c | 4 +-
+ composite/compwindow.c | 4 +++
+ dix/dispatch.c | 58 ++++++++++++++++++++++++++++++++++++++++---
+ dix/events.c | 37 +++++++++-----------------
+ dix/selection.c | 6 ++--
+ hw/xfree86/common/xf86DGA.c | 4 +-
+ include/dix.h | 1 -
+ mi/miexpose.c | 4 +-
+ 8 files changed, 80 insertions(+), 38 deletions(-)
+
+diff --git a/Xext/xvmain.c b/Xext/xvmain.c
+index fcca724..5425cc4 100644
+--- a/Xext/xvmain.c
++++ b/Xext/xvmain.c
+@@ -542,7 +542,7 @@ int reason;
+ event.u.videoNotify.drawable = pDraw->id;
+ event.u.videoNotify.port = pPort->id;
+ event.u.videoNotify.reason = reason;
+- TryClientEvents(pn->client, NULL, (xEventPtr)&event, 1,
++ TryClientEvents(pn->client, (xEventPtr)&event, 1,
+ NoEventMask, NoEventMask, NullGrab);
+ }
+ pn = pn->next;
+@@ -574,7 +574,7 @@ XvdiSendPortNotify(
+ event.u.portNotify.port = pPort->id;
+ event.u.portNotify.attribute = attribute;
+ event.u.portNotify.value = value;
+- TryClientEvents(pn->client, NULL, (xEventPtr)&event, 1,
++ TryClientEvents(pn->client, (xEventPtr)&event, 1,
+ NoEventMask, NoEventMask, NullGrab);
+ }
+ pn = pn->next;
+diff --git a/composite/compwindow.c b/composite/compwindow.c
+index 6b98c58..7ce1dd7 100644
+--- a/composite/compwindow.c
++++ b/composite/compwindow.c
+@@ -986,6 +986,8 @@ CompositeXYParentToChild (WindowPtr pChild,
+ /* There is no mesh, handle events like normal */
+ if (!cw || !cw->pInputMesh)
+ return TRUE;
++
++ return FALSE;
+ }
+
+ Bool
+@@ -1036,6 +1038,8 @@ CompositeXYChildToParent (WindowPtr pChild,
+ /* There is no mesh, handle events like normal */
+ if (!cw || !cw->pInputMesh)
+ return TRUE;
++
++ return TRUE;
+ }
+
+ void
+diff --git a/dix/dispatch.c b/dix/dispatch.c
+index c4a6a9c..da0b9e8 100644
+--- a/dix/dispatch.c
++++ b/dix/dispatch.c
+@@ -151,6 +151,10 @@ typedef const char *string;
+ #include "Xserver-dtrace.h"
+ #endif
+
++//#ifdef COMPOSITE
++#include "compint.h"
++//#endif
++
+ #define mskcnt ((MAXCLIENTS + 31) / 32)
+ #define BITMASK(i) (1U << ((i) & 31))
+ #define MASKIDX(i) ((i) >> 5)
+@@ -1022,16 +1026,63 @@ ProcTranslateCoords(ClientPtr client)
+ }
+ else
+ {
+- INT16 x, y;
++ int x, y, rootX, rootY;
+ rep.sameScreen = xTrue;
+ rep.child = None;
+ /* computing absolute coordinates -- adjust to destination later */
+ x = pWin->drawable.x + stuff->srcX;
+ y = pWin->drawable.y + stuff->srcY;
++
++
++
++#ifdef COMPOSITE
++ /*
++ * Transform from source window coordinate space to screen
++ * and then to destination coordinate space.
++ */
++ CompositeXYScreenFromWindowRootCoordinate (pWin, x, y, &x, &y);
++ CompositeXYScreenToWindowRootCoordinate (pDst, x, y, &x, &y);
++#endif
++
++ /* adjust to destination coordinates */
++ rep.dstX = x - pDst->drawable.x;
++ rep.dstY = y - pDst->drawable.y;
++
++ rootX = x;
++ rootY = y;
++
+ pWin = pDst->firstChild;
+ while (pWin)
+ {
+ BoxRec box;
++
++
++ x = rootX;
++ y = rootY;
++
++#ifdef COMPOSITE
++ /*
++ * Transform from parent to child.
++ */
++ if (pWin->mapped)
++ {
++ if (pWin->parent)
++ {
++ x = rootX - pWin->parent->drawable.x;
++ y = rootY - pWin->parent->drawable.y;
++ }
++
++ CompositeXYParentToChild (pWin, x, y, &x, &y);
++
++ if (pWin->parent)
++ {
++ x += pWin->parent->drawable.x;
++ y += pWin->parent->drawable.y;
++ }
++ }
++#endif
++
++
+ if ((pWin->mapped) &&
+ (x >= pWin->drawable.x - wBorderWidth (pWin)) &&
+ (x < pWin->drawable.x + (int)pWin->drawable.width +
+@@ -1054,15 +1105,14 @@ ProcTranslateCoords(ClientPtr client)
+ y - pWin->drawable.y, &box))
+ )
+ {
++ rootX = x;
++ rootY = y;
+ rep.child = pWin->drawable.id;
+ pWin = (WindowPtr) NULL;
+ }
+ else
+ pWin = pWin->nextSib;
+ }
+- /* adjust to destination coordinates */
+- rep.dstX = x - pDst->drawable.x;
+- rep.dstY = y - pDst->drawable.y;
+ }
+ WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
+ return(client->noClientException);
+diff --git a/dix/events.c b/dix/events.c
+index 05fce0d..f8ae8f3 100644
+--- a/dix/events.c
++++ b/dix/events.c
+@@ -1954,9 +1954,8 @@ ReleaseActiveGrabs(ClientPtr client)
+ * @return 1 if event was delivered, 0 if not or -1 if grab was not set by the
+ * client.
+ */
+-
+ _X_EXPORT int
+-TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
++TryClientEvents (ClientPtr client, xEvent *pEvents,
+ int count, Mask mask, Mask filter, GrabPtr grab)
+ {
+ int i;
+@@ -1976,15 +1975,6 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
+ {
+ if (mask & PointerMotionHintMask)
+ {
+- if (WID(dev->valuator->motionHintWindow) ==
+- pEvents->u.keyButtonPointer.event)
+- {
+-#ifdef DEBUG_EVENTS
+- ErrorF("[dix] \n");
+- ErrorF("[dix] motionHintWindow == keyButtonPointer.event\n");
+-#endif
+- return 1; /* don't send, but pretend we did */
+- }
+ pEvents->u.u.detail = NotifyHint;
+ }
+ else
+@@ -2029,7 +2019,6 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
+ }
+ }
+
+-
+ /**
+ * Deliver events to a window. At this point, we do not yet know if the event
+ * actually needs to be delivered. May activate a grab if the event is a
+@@ -2085,7 +2074,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
+
+ if (XaceHook(XACE_RECEIVE_ACCESS, wClient(pWin), pWin, pEvents, count))
+ /* do nothing */;
+- else if ( (attempt = TryClientEvents(wClient(pWin), pDev, pEvents,
++ else if ( (attempt = TryClientEvents(wClient(pWin), pEvents,
+ count, pWin->eventMask,
+ filter, grab)) )
+ {
+@@ -2124,7 +2113,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
+ if (XaceHook(XACE_RECEIVE_ACCESS, rClient(gmask), pWin,
+ pEvents, count))
+ /* do nothing */;
+- else if (TryClientEvents(rClient(gmask), pDev,
++ else if (TryClientEvents(rClient(gmask),
+ pEvents, count,
+ gmask->eventMask[GEEXTIDX(pEvents)],
+ filter, grab) > 0)
+@@ -2159,7 +2148,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
+ if (XaceHook(XACE_RECEIVE_ACCESS, rClient(other), pWin,
+ pEvents, count))
+ /* do nothing */;
+- else if ( (attempt = TryClientEvents(rClient(other), pDev,
++ else if ( (attempt = TryClientEvents(rClient(other),
+ pEvents, count,
+ other->mask[mskidx],
+ filter, grab)) )
+@@ -2288,7 +2277,7 @@ MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents,
+ #endif
+ if (XaceHook(XACE_RECEIVE_ACCESS, wClient(pWin), pWin, pEvents, count))
+ return 1; /* don't send, but pretend we did */
+- return TryClientEvents(wClient(pWin), NULL, pEvents, count,
++ return TryClientEvents(wClient(pWin), pEvents, count,
+ pWin->eventMask, filter, NullGrab);
+ }
+ for (other = wOtherClients(pWin); other; other = other->next)
+@@ -2305,7 +2294,7 @@ MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents,
+ if (XaceHook(XACE_RECEIVE_ACCESS, rClient(other), pWin, pEvents,
+ count))
+ return 1; /* don't send, but pretend we did */
+- return TryClientEvents(rClient(other), NULL, pEvents, count,
++ return TryClientEvents(rClient(other), pEvents, count,
+ other->mask, filter, NullGrab);
+ }
+ }
+@@ -3476,7 +3465,7 @@ CheckPassiveGrabsOnWindow(
+
+ FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
+
+- (void) TryClientEvents(rClient(grab), device, xE, count,
++ (void) TryClientEvents(rClient(grab), xE, count,
+ filters[device->id][xE->u.u.type],
+ filters[device->id][xE->u.u.type], grab);
+
+@@ -3721,7 +3710,7 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
+
+ if (GEEventFill(xE))
+ GEEventFill(xE)(ge, thisDev, grab->window, grab);
+- deliveries = TryClientEvents(rClient(grab), thisDev, xE,
++ deliveries = TryClientEvents(rClient(grab), xE,
+ count, gemask->eventMask[GEEXTIDX(ge)],
+ generic_filters[GEEXTIDX(ge)][ge->evtype],
+ grab);
+@@ -3746,7 +3735,7 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
+ else if (!IsInterferingGrab(rClient(grab), thisDev,
+ &core))
+ {
+- deliveries = TryClientEvents(rClient(grab), thisDev,
++ deliveries = TryClientEvents(rClient(grab),
+ &core, 1, mask,
+ filters[thisDev->id][core.u.u.type],
+ grab);
+@@ -3772,7 +3761,7 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
+ else
+ {
+ deliveries =
+- TryClientEvents(rClient(grab), thisDev,
++ TryClientEvents(rClient(grab),
+ xE, count,
+ mask,
+ filters[thisDev->id][xE->u.u.type],
+@@ -4468,7 +4457,7 @@ EnterLeaveEvent(
+ if ((mask & filters[mouse->id][type]) && sendevent)
+ {
+ if (grab)
+- TryClientEvents(rClient(grab), mouse, &event, 1, mask,
++ TryClientEvents(rClient(grab), &event, 1, mask,
+ filters[mouse->id][type], grab);
+ else
+ DeliverEventsToWindow(mouse, pWin, &event, 1,
+@@ -4496,7 +4485,7 @@ EnterLeaveEvent(
+ inputMasks->deliverableEvents[mskidx]))
+ {
+ if (devgrab)
+- (void)TryClientEvents(rClient(devgrab), mouse,
++ (void)TryClientEvents(rClient(devgrab),
+ (xEvent*)devEnterLeave, 1,
+ mask, filters[mouse->id][devEnterLeave->type],
+ devgrab);
+@@ -4518,7 +4507,7 @@ EnterLeaveEvent(
+
+ ke.type = KeymapNotify;
+ if (grab)
+- (void)TryClientEvents(rClient(grab), keybd, (xEvent *)&ke, 1,
++ (void)TryClientEvents(rClient(grab), (xEvent *)&ke, 1,
+ mask, KeymapStateMask, grab);
+ else
+ (void)DeliverEventsToWindow(mouse, pWin, (xEvent *)&ke, 1,
+diff --git a/dix/selection.c b/dix/selection.c
+index c5427e0..1aa974b 100644
+--- a/dix/selection.c
++++ b/dix/selection.c
+@@ -189,7 +189,7 @@ ProcSetSelectionOwner(ClientPtr client)
+ event.u.selectionClear.time = time.milliseconds;
+ event.u.selectionClear.window = pSel->window;
+ event.u.selectionClear.atom = pSel->selection;
+- TryClientEvents(pSel->client, NULL, &event, 1, NoEventMask,
++ TryClientEvents(pSel->client, &event, 1, NoEventMask,
+ NoEventMask /* CantBeFiltered */, NullGrab);
+ }
+ }
+@@ -294,7 +294,7 @@ ProcConvertSelection(ClientPtr client)
+ event.u.selectionRequest.selection = stuff->selection;
+ event.u.selectionRequest.target = stuff->target;
+ event.u.selectionRequest.property = stuff->property;
+- if (TryClientEvents(pSel->client, NULL, &event, 1, NoEventMask,
++ if (TryClientEvents(pSel->client, &event, 1, NoEventMask,
+ NoEventMask /* CantBeFiltered */, NullGrab))
+ return client->noClientException;
+ }
+@@ -305,7 +305,7 @@ ProcConvertSelection(ClientPtr client)
+ event.u.selectionNotify.selection = stuff->selection;
+ event.u.selectionNotify.target = stuff->target;
+ event.u.selectionNotify.property = None;
+- TryClientEvents(client, NULL, &event, 1, NoEventMask,
++ TryClientEvents(client, &event, 1, NoEventMask,
+ NoEventMask /* CantBeFiltered */, NullGrab);
+ return client->noClientException;
+ }
+diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
+index 83bc411..4f9e3cf 100644
+--- a/hw/xfree86/common/xf86DGA.c
++++ b/hw/xfree86/common/xf86DGA.c
+@@ -1057,7 +1057,7 @@ DGAProcessKeyboardEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr keybd)
+ if (pScreenPriv->client)
+ {
+ /* If the DGA client has selected input, then deliver based on the usual filter */
+- TryClientEvents (pScreenPriv->client, keybd, (xEvent *) de, 1,
++ TryClientEvents (pScreenPriv->client, (xEvent *) de, 1,
+ filters[coreEquiv], pScreenPriv->input, 0);
+ }
+ else
+@@ -1104,7 +1104,7 @@ DGAProcessPointerEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr mouse)
+ if (pScreenPriv->client)
+ {
+ /* If the DGA client has selected input, then deliver based on the usual filter */
+- TryClientEvents (pScreenPriv->client, mouse, (xEvent *) de, 1,
++ TryClientEvents (pScreenPriv->client, (xEvent *) de, 1,
+ filters[coreEquiv], pScreenPriv->input, 0);
+ }
+ else
+diff --git a/include/dix.h b/include/dix.h
+index 76ddbb5..27cd782 100644
+--- a/include/dix.h
++++ b/include/dix.h
+@@ -492,7 +492,6 @@ extern void WriteEventsToClient(
+
+ extern int TryClientEvents(
+ ClientPtr /*client*/,
+- DeviceIntPtr /* device */,
+ xEventPtr /*pEvents*/,
+ int /*count*/,
+ Mask /*mask*/,
+diff --git a/mi/miexpose.c b/mi/miexpose.c
+index f8a9e2f..33eaae3 100644
+--- a/mi/miexpose.c
++++ b/mi/miexpose.c
+@@ -371,7 +371,7 @@ miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable,
+ pe->u.graphicsExposure.majorEvent = major;
+ pe->u.graphicsExposure.minorEvent = minor;
+ }
+- TryClientEvents(client, NULL, pEvent, numRects,
++ TryClientEvents(client, pEvent, numRects,
+ (Mask)0, NoEventMask, NullGrab);
+ xfree(pEvent);
+ }
+@@ -382,7 +382,7 @@ miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable,
+ event.u.noExposure.drawable = drawable;
+ event.u.noExposure.majorEvent = major;
+ event.u.noExposure.minorEvent = minor;
+- TryClientEvents(client, NULL, &event, 1,
++ TryClientEvents(client, &event, 1,
+ (Mask)0, NoEventMask, NullGrab);
+ }
+ }
+--
+1.5.6
+