dix: Restore PaintWindow screen hook
Removes the last cpp conditional on ROOTLESS from dix code. Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
74d64ceea0
commit
cbd3cfbad3
|
@ -104,7 +104,7 @@ compRepaintBorder(ClientPtr pClient, void *closure)
|
||||||
|
|
||||||
RegionNull(&exposed);
|
RegionNull(&exposed);
|
||||||
RegionSubtract(&exposed, &pWindow->borderClip, &pWindow->winSize);
|
RegionSubtract(&exposed, &pWindow->borderClip, &pWindow->winSize);
|
||||||
miPaintWindow(pWindow, &exposed, PW_BORDER);
|
pWindow->drawable.pScreen->PaintWindow(pWindow, &exposed, PW_BORDER);
|
||||||
RegionUninit(&exposed);
|
RegionUninit(&exposed);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -1467,7 +1467,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
|
|
||||||
RegionNull(&exposed);
|
RegionNull(&exposed);
|
||||||
RegionSubtract(&exposed, &pWin->borderClip, &pWin->winSize);
|
RegionSubtract(&exposed, &pWin->borderClip, &pWin->winSize);
|
||||||
miPaintWindow(pWin, &exposed, PW_BORDER);
|
pWin->drawable.pScreen->PaintWindow(pWin, &exposed, PW_BORDER);
|
||||||
RegionUninit(&exposed);
|
RegionUninit(&exposed);
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
|
@ -3034,7 +3034,7 @@ dixSaveScreens(ClientPtr client, int on, int mode)
|
||||||
|
|
||||||
/* make it look like screen saver is off, so that
|
/* make it look like screen saver is off, so that
|
||||||
* NotClippedByChildren will compute a clip list
|
* NotClippedByChildren will compute a clip list
|
||||||
* for the root window, so miPaintWindow works
|
* for the root window, so PaintWindow works
|
||||||
*/
|
*/
|
||||||
screenIsSaved = SCREEN_SAVER_OFF;
|
screenIsSaved = SCREEN_SAVER_OFF;
|
||||||
(*pWin->drawable.pScreen->MoveWindow) (pWin,
|
(*pWin->drawable.pScreen->MoveWindow) (pWin,
|
||||||
|
|
|
@ -300,8 +300,8 @@ QuartzUpdateScreens(void)
|
||||||
|
|
||||||
quartzProcs->UpdateScreen(pScreen);
|
quartzProcs->UpdateScreen(pScreen);
|
||||||
|
|
||||||
/* miPaintWindow needs to be called after RootlessUpdateScreenPixmap (from xprUpdateScreen) */
|
/* PaintWindow needs to be called after RootlessUpdateScreenPixmap (from xprUpdateScreen) */
|
||||||
miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
|
pScreen->PaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
|
||||||
|
|
||||||
/* Tell RandR about the new size, so new connections get the correct info */
|
/* Tell RandR about the new size, so new connections get the correct info */
|
||||||
RRScreenSizeNotify(pScreen);
|
RRScreenSizeNotify(pScreen);
|
||||||
|
|
|
@ -104,7 +104,7 @@ winDoRandRScreenSetSize(ScreenPtr pScreen,
|
||||||
SetRootClip(pScreen, TRUE);
|
SetRootClip(pScreen, TRUE);
|
||||||
|
|
||||||
// and arrange for it to be repainted
|
// and arrange for it to be repainted
|
||||||
miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
|
pScreen->PaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
|
||||||
|
|
||||||
/* Indicate that a screen size change took place */
|
/* Indicate that a screen size change took place */
|
||||||
RRScreenSizeNotify(pScreen);
|
RRScreenSizeNotify(pScreen);
|
||||||
|
|
|
@ -158,6 +158,10 @@ typedef void (*PostValidateTreeProcPtr) (WindowPtr /*pParent */ ,
|
||||||
typedef void (*WindowExposuresProcPtr) (WindowPtr /*pWindow */ ,
|
typedef void (*WindowExposuresProcPtr) (WindowPtr /*pWindow */ ,
|
||||||
RegionPtr /*prgn */);
|
RegionPtr /*prgn */);
|
||||||
|
|
||||||
|
typedef void (*PaintWindowProcPtr) (WindowPtr /*pWindow*/,
|
||||||
|
RegionPtr /*pRegion*/,
|
||||||
|
int /*what*/);
|
||||||
|
|
||||||
typedef void (*CopyWindowProcPtr) (WindowPtr /*pWindow */ ,
|
typedef void (*CopyWindowProcPtr) (WindowPtr /*pWindow */ ,
|
||||||
DDXPointRec /*ptOldOrg */ ,
|
DDXPointRec /*ptOldOrg */ ,
|
||||||
RegionPtr /*prgnSrc */ );
|
RegionPtr /*prgnSrc */ );
|
||||||
|
@ -498,6 +502,7 @@ typedef struct _Screen {
|
||||||
ClearToBackgroundProcPtr ClearToBackground;
|
ClearToBackgroundProcPtr ClearToBackground;
|
||||||
ClipNotifyProcPtr ClipNotify;
|
ClipNotifyProcPtr ClipNotify;
|
||||||
RestackWindowProcPtr RestackWindow;
|
RestackWindowProcPtr RestackWindow;
|
||||||
|
PaintWindowProcPtr PaintWindow;
|
||||||
|
|
||||||
/* Pixmap procedures */
|
/* Pixmap procedures */
|
||||||
|
|
||||||
|
|
|
@ -268,10 +268,11 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
|
||||||
RegionTranslate(&rgnExposed, pDstDrawable->x, pDstDrawable->y);
|
RegionTranslate(&rgnExposed, pDstDrawable->x, pDstDrawable->y);
|
||||||
|
|
||||||
if (extents) {
|
if (extents) {
|
||||||
/* miPaintWindow doesn't clip, so we have to */
|
/* PaintWindow doesn't clip, so we have to */
|
||||||
RegionIntersect(&rgnExposed, &rgnExposed, &pWin->clipList);
|
RegionIntersect(&rgnExposed, &rgnExposed, &pWin->clipList);
|
||||||
}
|
}
|
||||||
miPaintWindow((WindowPtr) pDstDrawable, &rgnExposed, PW_BACKGROUND);
|
pDstDrawable->pScreen->PaintWindow((WindowPtr) pDstDrawable,
|
||||||
|
&rgnExposed, PW_BACKGROUND);
|
||||||
|
|
||||||
if (extents) {
|
if (extents) {
|
||||||
RegionReset(&rgnExposed, &expBox);
|
RegionReset(&rgnExposed, &expBox);
|
||||||
|
@ -383,16 +384,14 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn)
|
||||||
* work overall, on both client and server. This is cheating, but
|
* work overall, on both client and server. This is cheating, but
|
||||||
* isn't prohibited by the protocol ("spontaneous combustion" :-).
|
* isn't prohibited by the protocol ("spontaneous combustion" :-).
|
||||||
*/
|
*/
|
||||||
BoxRec box;
|
BoxRec box = *RegionExtents(prgn);
|
||||||
|
|
||||||
box = *RegionExtents(prgn);
|
|
||||||
exposures = &expRec;
|
exposures = &expRec;
|
||||||
RegionInit(exposures, &box, 1);
|
RegionInit(exposures, &box, 1);
|
||||||
RegionReset(prgn, &box);
|
RegionReset(prgn, &box);
|
||||||
/* miPaintWindow doesn't clip, so we have to */
|
/* miPaintWindow doesn't clip, so we have to */
|
||||||
RegionIntersect(prgn, prgn, &pWin->clipList);
|
RegionIntersect(prgn, prgn, &pWin->clipList);
|
||||||
}
|
}
|
||||||
miPaintWindow(pWin, prgn, PW_BACKGROUND);
|
pWin->drawable.pScreen->PaintWindow(pWin, prgn, PW_BACKGROUND);
|
||||||
if (clientInterested)
|
if (clientInterested)
|
||||||
miSendExposures(pWin, exposures,
|
miSendExposures(pWin, exposures,
|
||||||
pWin->drawable.x, pWin->drawable.y);
|
pWin->drawable.x, pWin->drawable.y);
|
||||||
|
@ -402,14 +401,6 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ROOTLESS
|
|
||||||
/* Ugly, ugly, but we lost our hooks into miPaintWindow... =/ */
|
|
||||||
void RootlessSetPixmapOfAncestors(WindowPtr pWin);
|
|
||||||
void RootlessStartDrawing(WindowPtr pWin);
|
|
||||||
void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
|
|
||||||
Bool IsFramedWindow(WindowPtr pWin);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
|
miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
|
||||||
{
|
{
|
||||||
|
@ -437,19 +428,6 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
|
||||||
Bool solid = TRUE;
|
Bool solid = TRUE;
|
||||||
DrawablePtr drawable = &pWin->drawable;
|
DrawablePtr drawable = &pWin->drawable;
|
||||||
|
|
||||||
#ifdef ROOTLESS
|
|
||||||
if (IsFramedWindow(pWin)) {
|
|
||||||
RootlessStartDrawing(pWin);
|
|
||||||
RootlessDamageRegion(pWin, prgn);
|
|
||||||
|
|
||||||
if (pWin->backgroundState == ParentRelative) {
|
|
||||||
if ((what == PW_BACKGROUND) ||
|
|
||||||
(what == PW_BORDER && !pWin->borderIsPixel))
|
|
||||||
RootlessSetPixmapOfAncestors(pWin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (what == PW_BACKGROUND) {
|
if (what == PW_BACKGROUND) {
|
||||||
while (pWin->backgroundState == ParentRelative)
|
while (pWin->backgroundState == ParentRelative)
|
||||||
pWin = pWin->parent;
|
pWin = pWin->parent;
|
||||||
|
|
|
@ -844,8 +844,8 @@ miOverlayHandleExposures(WindowPtr pWin)
|
||||||
if ((mival = pTree->valdata)) {
|
if ((mival = pTree->valdata)) {
|
||||||
if (!((*pPriv->InOverlay) (pTree->pWin))) {
|
if (!((*pPriv->InOverlay) (pTree->pWin))) {
|
||||||
if (RegionNotEmpty(&mival->borderExposed)) {
|
if (RegionNotEmpty(&mival->borderExposed)) {
|
||||||
miPaintWindow(pTree->pWin, &mival->borderExposed,
|
pScreen->PaintWindow(pTree->pWin, &mival->borderExposed,
|
||||||
PW_BORDER);
|
PW_BORDER);
|
||||||
}
|
}
|
||||||
RegionUninit(&mival->borderExposed);
|
RegionUninit(&mival->borderExposed);
|
||||||
|
|
||||||
|
@ -883,7 +883,8 @@ miOverlayHandleExposures(WindowPtr pWin)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (RegionNotEmpty(&val->after.borderExposed)) {
|
if (RegionNotEmpty(&val->after.borderExposed)) {
|
||||||
miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER);
|
pScreen->PaintWindow(pChild, &val->after.borderExposed,
|
||||||
|
PW_BORDER);
|
||||||
}
|
}
|
||||||
(*WindowExposures) (pChild, &val->after.exposed);
|
(*WindowExposures) (pChild, &val->after.exposed);
|
||||||
}
|
}
|
||||||
|
@ -982,6 +983,7 @@ static void
|
||||||
miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn)
|
miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn)
|
||||||
{
|
{
|
||||||
RegionPtr exposures = prgn;
|
RegionPtr exposures = prgn;
|
||||||
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
|
|
||||||
if (prgn && !RegionNil(prgn)) {
|
if (prgn && !RegionNil(prgn)) {
|
||||||
RegionRec expRec;
|
RegionRec expRec;
|
||||||
|
@ -1007,7 +1009,7 @@ miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn)
|
||||||
else
|
else
|
||||||
RegionIntersect(prgn, prgn, &pWin->clipList);
|
RegionIntersect(prgn, prgn, &pWin->clipList);
|
||||||
}
|
}
|
||||||
miPaintWindow(pWin, prgn, PW_BACKGROUND);
|
pScreen->PaintWindow(pWin, prgn, PW_BACKGROUND);
|
||||||
if (clientInterested)
|
if (clientInterested)
|
||||||
miSendExposures(pWin, exposures,
|
miSendExposures(pWin, exposures,
|
||||||
pWin->drawable.x, pWin->drawable.y);
|
pWin->drawable.x, pWin->drawable.y);
|
||||||
|
@ -1606,7 +1608,7 @@ miOverlayClearToBackground(WindowPtr pWin,
|
||||||
if (generateExposures)
|
if (generateExposures)
|
||||||
(*pScreen->WindowExposures) (pWin, ®);
|
(*pScreen->WindowExposures) (pWin, ®);
|
||||||
else if (pWin->backgroundState != None)
|
else if (pWin->backgroundState != None)
|
||||||
miPaintWindow(pWin, ®, PW_BACKGROUND);
|
pScreen->PaintWindow(pWin, ®, PW_BACKGROUND);
|
||||||
RegionUninit(®);
|
RegionUninit(®);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -253,6 +253,7 @@ miScreenInit(ScreenPtr pScreen, void *pbits, /* pointer to screen bits */
|
||||||
pScreen->ClearToBackground = miClearToBackground;
|
pScreen->ClearToBackground = miClearToBackground;
|
||||||
pScreen->ClipNotify = (ClipNotifyProcPtr) 0;
|
pScreen->ClipNotify = (ClipNotifyProcPtr) 0;
|
||||||
pScreen->RestackWindow = (RestackWindowProcPtr) 0;
|
pScreen->RestackWindow = (RestackWindowProcPtr) 0;
|
||||||
|
pScreen->PaintWindow = miPaintWindow;
|
||||||
/* CreatePixmap, DestroyPixmap */
|
/* CreatePixmap, DestroyPixmap */
|
||||||
/* RealizeFont, UnrealizeFont */
|
/* RealizeFont, UnrealizeFont */
|
||||||
/* CreateGC */
|
/* CreateGC */
|
||||||
|
|
|
@ -113,7 +113,7 @@ miClearToBackground(WindowPtr pWin,
|
||||||
if (generateExposures)
|
if (generateExposures)
|
||||||
(*pWin->drawable.pScreen->WindowExposures) (pWin, ®);
|
(*pWin->drawable.pScreen->WindowExposures) (pWin, ®);
|
||||||
else if (pWin->backgroundState != None)
|
else if (pWin->backgroundState != None)
|
||||||
miPaintWindow(pWin, ®, PW_BACKGROUND);
|
pWin->drawable.pScreen->PaintWindow(pWin, ®, PW_BACKGROUND);
|
||||||
RegionUninit(®);
|
RegionUninit(®);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,7 +219,9 @@ miHandleValidateExposures(WindowPtr pWin)
|
||||||
while (1) {
|
while (1) {
|
||||||
if ((val = pChild->valdata)) {
|
if ((val = pChild->valdata)) {
|
||||||
if (RegionNotEmpty(&val->after.borderExposed))
|
if (RegionNotEmpty(&val->after.borderExposed))
|
||||||
miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER);
|
pWin->drawable.pScreen->PaintWindow(pChild,
|
||||||
|
&val->after.borderExposed,
|
||||||
|
PW_BORDER);
|
||||||
RegionUninit(&val->after.borderExposed);
|
RegionUninit(&val->after.borderExposed);
|
||||||
(*WindowExposures) (pChild, &val->after.exposed);
|
(*WindowExposures) (pChild, &val->after.exposed);
|
||||||
RegionUninit(&val->after.exposed);
|
RegionUninit(&val->after.exposed);
|
||||||
|
|
|
@ -94,6 +94,7 @@ typedef struct _RootlessScreenRec {
|
||||||
ChangeBorderWidthProcPtr ChangeBorderWidth;
|
ChangeBorderWidthProcPtr ChangeBorderWidth;
|
||||||
PositionWindowProcPtr PositionWindow;
|
PositionWindowProcPtr PositionWindow;
|
||||||
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
|
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
|
||||||
|
PaintWindowProcPtr PaintWindow;
|
||||||
|
|
||||||
CreateGCProcPtr CreateGC;
|
CreateGCProcPtr CreateGC;
|
||||||
CopyWindowProcPtr CopyWindow;
|
CopyWindowProcPtr CopyWindow;
|
||||||
|
|
|
@ -473,7 +473,7 @@ expose_1(WindowPtr pWin)
|
||||||
if (!pWin->realized)
|
if (!pWin->realized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
miPaintWindow(pWin, &pWin->borderClip, PW_BACKGROUND);
|
pWin->drawable.pScreen->PaintWindow(pWin, &pWin->borderClip, PW_BACKGROUND);
|
||||||
|
|
||||||
/* FIXME: comments in windowstr.h indicate that borderClip doesn't
|
/* FIXME: comments in windowstr.h indicate that borderClip doesn't
|
||||||
include subwindow visibility. But I'm not so sure.. so we may
|
include subwindow visibility. But I'm not so sure.. so we may
|
||||||
|
@ -669,6 +669,7 @@ RootlessWrap(ScreenPtr pScreen)
|
||||||
WRAP(CloseScreen);
|
WRAP(CloseScreen);
|
||||||
WRAP(CreateGC);
|
WRAP(CreateGC);
|
||||||
WRAP(CopyWindow);
|
WRAP(CopyWindow);
|
||||||
|
WRAP(PaintWindow);
|
||||||
WRAP(GetImage);
|
WRAP(GetImage);
|
||||||
WRAP(SourceValidate);
|
WRAP(SourceValidate);
|
||||||
WRAP(CreateWindow);
|
WRAP(CreateWindow);
|
||||||
|
|
|
@ -720,7 +720,7 @@ RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
|
||||||
/*
|
/*
|
||||||
* RootlessCopyWindow
|
* RootlessCopyWindow
|
||||||
* Update *new* location of window. Old location is redrawn with
|
* Update *new* location of window. Old location is redrawn with
|
||||||
* miPaintWindow. Cloned from fbCopyWindow.
|
* PaintWindow. Cloned from fbCopyWindow.
|
||||||
* The original always draws on the root pixmap, which we don't have.
|
* The original always draws on the root pixmap, which we don't have.
|
||||||
* Instead, draw on the parent window's pixmap.
|
* Instead, draw on the parent window's pixmap.
|
||||||
*/
|
*/
|
||||||
|
@ -794,6 +794,27 @@ RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
||||||
RL_DEBUG_MSG("copywindowFB end\n");
|
RL_DEBUG_MSG("copywindowFB end\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RootlessPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
|
|
||||||
|
if (IsFramedWindow(pWin)) {
|
||||||
|
RootlessStartDrawing(pWin);
|
||||||
|
RootlessDamageRegion(pWin, prgn);
|
||||||
|
|
||||||
|
if (pWin->backgroundState == ParentRelative) {
|
||||||
|
if ((what == PW_BACKGROUND) ||
|
||||||
|
(what == PW_BORDER && !pWin->borderIsPixel))
|
||||||
|
RootlessSetPixmapOfAncestors(pWin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SCREEN_UNWRAP(pScreen, PaintWindow);
|
||||||
|
pScreen->PaintWindow(pWin, prgn, what);
|
||||||
|
SCREEN_WRAP(pScreen, PaintWindow);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Window resize procedures
|
* Window resize procedures
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -48,6 +48,7 @@ Bool RootlessUnrealizeWindow(WindowPtr pWin);
|
||||||
void RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib);
|
void RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib);
|
||||||
void RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
|
void RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
|
||||||
RegionPtr prgnSrc);
|
RegionPtr prgnSrc);
|
||||||
|
void RootlessPaintWindow(WindowPtr pWin, RegionPtr prgn, int what);
|
||||||
void RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib,
|
void RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib,
|
||||||
VTKind kind);
|
VTKind kind);
|
||||||
void RootlessResizeWindow(WindowPtr pWin, int x, int y, unsigned int w,
|
void RootlessResizeWindow(WindowPtr pWin, int x, int y, unsigned int w,
|
||||||
|
|
Loading…
Reference in New Issue