aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix')
-rw-r--r--xorg-server/dix/devices.c57
-rwxr-xr-xxorg-server/dix/dispatch.c52
-rw-r--r--xorg-server/dix/protocol.txt30
-rw-r--r--xorg-server/dix/window.c73
4 files changed, 79 insertions, 133 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index ce64dfeda..d43d29ded 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -1219,63 +1219,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 f6ed81302..36f9418ca 100755
--- a/xorg-server/dix/dispatch.c
+++ b/xorg-server/dix/dispatch.c
@@ -1643,6 +1643,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)
{
@@ -1674,8 +1720,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);
}
@@ -1722,8 +1767,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 7bbfc719b..4af933fa6 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 */
@@ -1555,7 +1554,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;
}
@@ -1817,8 +1816,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
@@ -1852,7 +1849,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)
@@ -1958,7 +1955,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;
@@ -2066,10 +2063,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();
@@ -2096,8 +2093,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))
@@ -2583,10 +2579,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();
}
@@ -2604,7 +2600,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);
}
@@ -2648,8 +2644,7 @@ MapSubwindows(WindowPtr pParent, ClientPtr client)
RealizeTree(pWin);
if (pWin->viewable) {
anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin, pWin,
- (WindowPtr
- *) NULL);
+ NULL);
}
}
}
@@ -2659,17 +2654,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();
}
}
@@ -2763,9 +2757,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();
@@ -2810,8 +2804,6 @@ UnmapSubwindows(WindowPtr pWin)
pChild->mapped = FALSE;
if (pChild->realized)
UnrealizeTree(pChild, FALSE);
- if (wasViewable) {
- }
}
}
if (wasViewable) {
@@ -2821,8 +2813,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 */
@@ -2836,9 +2827,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();
@@ -2881,7 +2873,7 @@ HandleSaveSet(ClientPtr client)
}
free(client->saveSet);
client->numSaved = 0;
- client->saveSet = (SaveSetElt *) NULL;
+ client->saveSet = NULL;
}
/**
@@ -3597,22 +3589,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();