summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2014-09-12 12:51:13 -0400
committerAdam Jackson <ajax@redhat.com>2014-10-09 11:14:53 +0200
commit1e56b2dfc6377234ffdcdf206528d476b04d13af (patch)
treee036f5c967f2984c0bcf234e100f0dd5b899cf4a /dix
parent5d3bd8a3dc6456ea1ccf7b5f71b972379d7565ec (diff)
mi: Move pScreen->SendGraphicsExpose up to dix
No DDX is overriding this and it's fairly absurd to expose it as a screen operation anyway. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'dix')
-rw-r--r--dix/dispatch.c52
1 files changed, 48 insertions, 4 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c
index f7a08f82e..74abecd67 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1597,6 +1597,52 @@ ProcClearToBackground(ClientPtr client)
return Success;
}
+/* send GraphicsExpose events, or a NoExpose event, based on the region */
+void
+SendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable,
+ int major, int minor)
+{
+ if (pRgn && !RegionNil(pRgn)) {
+ xEvent *pEvent;
+ xEvent *pe;
+ BoxPtr pBox;
+ int i;
+ int numRects;
+
+ numRects = RegionNumRects(pRgn);
+ pBox = RegionRects(pRgn);
+ if (!(pEvent = calloc(numRects, sizeof(xEvent))))
+ return;
+ pe = pEvent;
+
+ for (i = 1; i <= numRects; i++, pe++, pBox++) {
+ pe->u.u.type = GraphicsExpose;
+ pe->u.graphicsExposure.drawable = drawable;
+ pe->u.graphicsExposure.x = pBox->x1;
+ pe->u.graphicsExposure.y = pBox->y1;
+ pe->u.graphicsExposure.width = pBox->x2 - pBox->x1;
+ pe->u.graphicsExposure.height = pBox->y2 - pBox->y1;
+ pe->u.graphicsExposure.count = numRects - i;
+ pe->u.graphicsExposure.majorEvent = major;
+ pe->u.graphicsExposure.minorEvent = minor;
+ }
+ /* GraphicsExpose is a "critical event", which TryClientEvents
+ * handles specially. */
+ TryClientEvents(client, NULL, pEvent, numRects,
+ (Mask) 0, NoEventMask, NullGrab);
+ free(pEvent);
+ }
+ else {
+ xEvent event = {
+ .u.noExposure.drawable = drawable,
+ .u.noExposure.majorEvent = major,
+ .u.noExposure.minorEvent = minor
+ };
+ event.u.u.type = NoExpose;
+ WriteEventsToClient(client, 1, &event);
+ }
+}
+
int
ProcCopyArea(ClientPtr client)
{
@@ -1628,8 +1674,7 @@ ProcCopyArea(ClientPtr client)
stuff->width, stuff->height,
stuff->dstX, stuff->dstY);
if (pGC->graphicsExposures) {
- (*pDst->pScreen->SendGraphicsExpose)
- (client, pRgn, stuff->dstDrawable, X_CopyArea, 0);
+ SendGraphicsExpose(client, pRgn, stuff->dstDrawable, X_CopyArea, 0);
if (pRgn)
RegionDestroy(pRgn);
}
@@ -1676,8 +1721,7 @@ ProcCopyPlane(ClientPtr client)
stuff->srcY, stuff->width, stuff->height,
stuff->dstX, stuff->dstY, stuff->bitPlane);
if (pGC->graphicsExposures) {
- (*pdstDraw->pScreen->SendGraphicsExpose)
- (client, pRgn, stuff->dstDrawable, X_CopyPlane, 0);
+ SendGraphicsExpose(client, pRgn, stuff->dstDrawable, X_CopyPlane, 0);
if (pRgn)
RegionDestroy(pRgn);
}