diff options
Diffstat (limited to 'xorg-server/dix')
-rw-r--r-- | xorg-server/dix/devices.c | 57 | ||||
-rw-r--r-- | xorg-server/dix/dispatch.c | 52 | ||||
-rw-r--r-- | xorg-server/dix/protocol.txt | 30 | ||||
-rw-r--r-- | xorg-server/dix/window.c | 73 |
4 files changed, 79 insertions, 133 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c index f17a3ac65..3fb7ca0fb 100644 --- a/xorg-server/dix/devices.c +++ b/xorg-server/dix/devices.c @@ -1214,63 +1214,6 @@ QueryMinMaxKeyCodes(KeyCode *minCode, KeyCode *maxCode) } } -/* Notably, this function does not expand the destination's keycode range, or - * notify clients. */ -Bool -SetKeySymsMap(KeySymsPtr dst, KeySymsPtr src) -{ - int i, j; - KeySym *tmp; - int rowDif = src->minKeyCode - dst->minKeyCode; - - /* if keysym map size changes, grow map first */ - if (src->mapWidth < dst->mapWidth) { - for (i = src->minKeyCode; i <= src->maxKeyCode; i++) { -#define SI(r, c) (((r - src->minKeyCode) * src->mapWidth) + (c)) -#define DI(r, c) (((r - dst->minKeyCode) * dst->mapWidth) + (c)) - for (j = 0; j < src->mapWidth; j++) - dst->map[DI(i, j)] = src->map[SI(i, j)]; - for (j = src->mapWidth; j < dst->mapWidth; j++) - dst->map[DI(i, j)] = NoSymbol; -#undef SI -#undef DI - } - return TRUE; - } - else if (src->mapWidth > dst->mapWidth) { - i = sizeof(KeySym) * src->mapWidth * - (dst->maxKeyCode - dst->minKeyCode + 1); - tmp = calloc(sizeof(KeySym), i); - if (!tmp) - return FALSE; - - if (dst->map) { - for (i = 0; i <= dst->maxKeyCode - dst->minKeyCode; i++) - memmove(&tmp[i * src->mapWidth], &dst->map[i * dst->mapWidth], - dst->mapWidth * sizeof(KeySym)); - free(dst->map); - } - dst->mapWidth = src->mapWidth; - dst->map = tmp; - } - else if (!dst->map) { - i = sizeof(KeySym) * src->mapWidth * - (dst->maxKeyCode - dst->minKeyCode + 1); - tmp = calloc(sizeof(KeySym), i); - if (!tmp) - return FALSE; - - dst->map = tmp; - dst->mapWidth = src->mapWidth; - } - - memmove(&dst->map[rowDif * dst->mapWidth], src->map, - (src->maxKeyCode - src->minKeyCode + 1) * - dst->mapWidth * sizeof(KeySym)); - - return TRUE; -} - Bool InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, Atom *labels, CARD8 *map) diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c index f7a08f82e..74abecd67 100644 --- a/xorg-server/dix/dispatch.c +++ b/xorg-server/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); } diff --git a/xorg-server/dix/protocol.txt b/xorg-server/dix/protocol.txt index f83f38c58..c22379581 100644 --- a/xorg-server/dix/protocol.txt +++ b/xorg-server/dix/protocol.txt @@ -1082,33 +1082,3 @@ R009 XVideo-MotionCompensation:GetDRInfo E000 XVideo-MotionCompensation:BadContext E001 XVideo-MotionCompensation:BadSurface E002 XVideo-MotionCompensation:BadSubpicture -R000 XpExtension:QueryVersion -R001 XpExtension:GetPrinterList -R002 XpExtension:CreateContext -R003 XpExtension:SetContext -R004 XpExtension:GetContext -R005 XpExtension:DestroyContext -R006 XpExtension:GetContextScreen -R007 XpExtension:StartJob -R008 XpExtension:EndJob -R009 XpExtension:StartDoc -R010 XpExtension:EndDoc -R011 XpExtension:PutDocumentData -R012 XpExtension:GetDocumentData -R013 XpExtension:StartPage -R014 XpExtension:EndPage -R015 XpExtension:SelectInput -R016 XpExtension:InputSelected -R017 XpExtension:GetAttributes -R018 XpExtension:SetAttributes -R019 XpExtension:GetOneAttribute -R020 XpExtension:RehashPrinterList -R021 XpExtension:GetPageDimensions -R022 XpExtension:QueryScreens -R023 XpExtension:SetImageResolution -R024 XpExtension:GetImageResolution -V000 XpExtension:PrintNotify -V001 XpExtension:AttributeNotify -E000 XpExtension:BadContext -E001 XpExtension:BadSequence -E002 XpExtension:BadResourceID diff --git a/xorg-server/dix/window.c b/xorg-server/dix/window.c index f4acdc889..d43ef0370 100644 --- a/xorg-server/dix/window.c +++ b/xorg-server/dix/window.c @@ -357,13 +357,12 @@ SetWindowToDefaults(WindowPtr pWin) pWin->firstChild = NullWindow; pWin->lastChild = NullWindow; - pWin->valdata = (ValidatePtr) NULL; - pWin->optional = (WindowOptPtr) NULL; + pWin->valdata = NULL; + pWin->optional = NULL; pWin->cursorIsNone = TRUE; pWin->backingStore = NotUseful; - pWin->DIXsaveUnder = FALSE; - pWin->backStorage = (void *) NULL; + pWin->backStorage = 0; pWin->mapped = FALSE; /* off */ pWin->realized = FALSE; /* off */ @@ -1551,7 +1550,7 @@ MoveWindowInStack(WindowPtr pWin, WindowPtr pNextSib) if (pWin->prevSib) pWin->prevSib->nextSib = pWin->nextSib; pWin->nextSib = pParent->firstChild; - pWin->prevSib = (WindowPtr) NULL; + pWin->prevSib = NULL; pNextSib->prevSib = pWin; pParent->firstChild = pWin; } @@ -1813,8 +1812,6 @@ ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh) #define ChangeMask ((Mask)(CWX | CWY | CWWidth | CWHeight)) -#define IllegalInputOnlyConfigureMask (CWBorderWidth) - /* * IsSiblingAboveMe * returns Above if pSib above pMe in stack or Below otherwise @@ -1848,7 +1845,7 @@ WindowExtents(WindowPtr pWin, BoxPtr pBox) return pBox; } -#define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL) +#define IS_SHAPED(pWin) (wBoundingShape (pWin) != NULL) static RegionPtr MakeBoundingRegion(WindowPtr pWin, BoxPtr pBox) @@ -1954,7 +1951,7 @@ WhereDoIGoInTheStack(WindowPtr pWin, WindowPtr pHead, pFirst; if ((pWin == pWin->parent->firstChild) && (pWin == pWin->parent->lastChild)) - return ((WindowPtr) NULL); + return NULL; pHead = RealChildHead(pWin->parent); pFirst = pHead ? pHead->nextSib : pWin->parent->firstChild; box.x1 = x; @@ -2062,10 +2059,10 @@ ReflectStackChange(WindowPtr pWin, WindowPtr pSib, VTKind kind) if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, pFirstChange, kind); (*pScreen->HandleExposures) (pLayerWin->parent); + if (pWin->drawable.pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstChange, + kind); } - if (anyMarked && pWin->drawable.pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstChange, - kind); } if (pWin->realized) WindowsRestructured(); @@ -2092,8 +2089,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) h = pWin->drawable.height, bw = pWin->borderWidth; int rc, action, smode = Above; - if ((pWin->drawable.class == InputOnly) && - (mask & IllegalInputOnlyConfigureMask)) + if ((pWin->drawable.class == InputOnly) && (mask & CWBorderWidth)) return BadMatch; if ((mask & CWSibling) && !(mask & CWStackMode)) @@ -2580,10 +2576,10 @@ MapWindow(WindowPtr pWin, ClientPtr client) if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, pLayerWin, VTMap); (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, + VTMap); } - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, - VTMap); } WindowsRestructured(); } @@ -2601,7 +2597,7 @@ MapWindow(WindowPtr pWin, ClientPtr client) (*pScreen->PostValidateTree) (NullWindow, pWin, VTMap); RegionNull(&temp); RegionCopy(&temp, &pWin->clipList); - (*pScreen->WindowExposures) (pWin, &temp, NullRegion); + (*pScreen->WindowExposures) (pWin, &temp); RegionUninit(&temp); } @@ -2645,8 +2641,7 @@ MapSubwindows(WindowPtr pParent, ClientPtr client) RealizeTree(pWin); if (pWin->viewable) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pWin, - (WindowPtr - *) NULL); + NULL); } } } @@ -2656,17 +2651,16 @@ MapSubwindows(WindowPtr pParent, ClientPtr client) pLayerWin = (*pScreen->GetLayerWindow) (pParent); if (pLayerWin->parent != pParent) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pLayerWin, - pLayerWin, - (WindowPtr *) NULL); + pLayerWin, NULL); pFirstMapped = pLayerWin; } if (anyMarked) { (*pScreen->ValidateTree) (pLayerWin->parent, pFirstMapped, VTMap); (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstMapped, + VTMap); } - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pFirstMapped, - VTMap); WindowsRestructured(); } } @@ -2760,9 +2754,9 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) if (!fromConfigure) { (*pScreen->ValidateTree) (pLayerWin->parent, pWin, VTUnmap); (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap); } - if (!fromConfigure && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pWin, VTUnmap); } if (wasRealized && !fromConfigure) { WindowsRestructured(); @@ -2807,8 +2801,6 @@ UnmapSubwindows(WindowPtr pWin) pChild->mapped = FALSE; if (pChild->realized) UnrealizeTree(pChild, FALSE); - if (wasViewable) { - } } } if (wasViewable) { @@ -2818,8 +2810,7 @@ UnmapSubwindows(WindowPtr pWin) else { WindowPtr ptmp; - (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, - (WindowPtr *) NULL); + (*pScreen->MarkOverlappedWindows) (pWin, pLayerWin, NULL); (*pScreen->MarkWindow) (pLayerWin->parent); /* Windows between pWin and pLayerWin may not have been marked */ @@ -2833,9 +2824,10 @@ UnmapSubwindows(WindowPtr pWin) } (*pScreen->ValidateTree) (pLayerWin->parent, pHead, VTUnmap); (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pHead, + VTUnmap); } - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pLayerWin->parent, pHead, VTUnmap); } if (wasRealized) { WindowsRestructured(); @@ -2878,7 +2870,7 @@ HandleSaveSet(ClientPtr client) } free(client->saveSet); client->numSaved = 0; - client->saveSet = (SaveSetElt *) NULL; + client->saveSet = NULL; } /** @@ -3594,22 +3586,19 @@ SetRootClip(ScreenPtr pScreen, Bool enable) if (pWin->firstChild) { anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin->firstChild, pWin->firstChild, - (WindowPtr *) NULL); + NULL); } else { (*pScreen->MarkWindow) (pWin); anyMarked = TRUE; } - if (anyMarked) + if (anyMarked) { (*pScreen->ValidateTree) (pWin, NullWindow, VTOther); - } - - if (WasViewable) { - if (anyMarked) (*pScreen->HandleExposures) (pWin); - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree) (pWin, NullWindow, VTOther); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pWin, NullWindow, VTOther); + } } if (pWin->realized) WindowsRestructured(); |