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:
		@@ -104,7 +104,7 @@ compRepaintBorder(ClientPtr pClient, void *closure)
 | 
			
		||||
 | 
			
		||||
        RegionNull(&exposed);
 | 
			
		||||
        RegionSubtract(&exposed, &pWindow->borderClip, &pWindow->winSize);
 | 
			
		||||
        miPaintWindow(pWindow, &exposed, PW_BORDER);
 | 
			
		||||
        pWindow->drawable.pScreen->PaintWindow(pWindow, &exposed, PW_BORDER);
 | 
			
		||||
        RegionUninit(&exposed);
 | 
			
		||||
    }
 | 
			
		||||
    return TRUE;
 | 
			
		||||
 
 | 
			
		||||
@@ -1467,7 +1467,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
 | 
			
		||||
 | 
			
		||||
        RegionNull(&exposed);
 | 
			
		||||
        RegionSubtract(&exposed, &pWin->borderClip, &pWin->winSize);
 | 
			
		||||
        miPaintWindow(pWin, &exposed, PW_BORDER);
 | 
			
		||||
        pWin->drawable.pScreen->PaintWindow(pWin, &exposed, PW_BORDER);
 | 
			
		||||
        RegionUninit(&exposed);
 | 
			
		||||
    }
 | 
			
		||||
    return error;
 | 
			
		||||
@@ -3034,7 +3034,7 @@ dixSaveScreens(ClientPtr client, int on, int mode)
 | 
			
		||||
 | 
			
		||||
                /* make it look like screen saver is off, so that
 | 
			
		||||
                 * NotClippedByChildren will compute a clip list
 | 
			
		||||
                 * for the root window, so miPaintWindow works
 | 
			
		||||
                 * for the root window, so PaintWindow works
 | 
			
		||||
                 */
 | 
			
		||||
                screenIsSaved = SCREEN_SAVER_OFF;
 | 
			
		||||
                (*pWin->drawable.pScreen->MoveWindow) (pWin,
 | 
			
		||||
 
 | 
			
		||||
@@ -300,8 +300,8 @@ QuartzUpdateScreens(void)
 | 
			
		||||
 | 
			
		||||
    quartzProcs->UpdateScreen(pScreen);
 | 
			
		||||
 | 
			
		||||
    /* miPaintWindow needs to be called after RootlessUpdateScreenPixmap (from xprUpdateScreen) */
 | 
			
		||||
    miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
 | 
			
		||||
    /* PaintWindow needs to be called after RootlessUpdateScreenPixmap (from xprUpdateScreen) */
 | 
			
		||||
    pScreen->PaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
 | 
			
		||||
 | 
			
		||||
    /* Tell RandR about the new size, so new connections get the correct info */
 | 
			
		||||
    RRScreenSizeNotify(pScreen);
 | 
			
		||||
 
 | 
			
		||||
@@ -104,7 +104,7 @@ winDoRandRScreenSetSize(ScreenPtr pScreen,
 | 
			
		||||
    SetRootClip(pScreen, TRUE);
 | 
			
		||||
 | 
			
		||||
    // 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 */
 | 
			
		||||
    RRScreenSizeNotify(pScreen);
 | 
			
		||||
 
 | 
			
		||||
@@ -158,6 +158,10 @@ typedef void (*PostValidateTreeProcPtr) (WindowPtr /*pParent */ ,
 | 
			
		||||
typedef void (*WindowExposuresProcPtr) (WindowPtr /*pWindow */ ,
 | 
			
		||||
                                        RegionPtr /*prgn */);
 | 
			
		||||
 | 
			
		||||
typedef void (*PaintWindowProcPtr) (WindowPtr /*pWindow*/,
 | 
			
		||||
                                    RegionPtr /*pRegion*/,
 | 
			
		||||
                                    int /*what*/);
 | 
			
		||||
 | 
			
		||||
typedef void (*CopyWindowProcPtr) (WindowPtr /*pWindow */ ,
 | 
			
		||||
                                   DDXPointRec /*ptOldOrg */ ,
 | 
			
		||||
                                   RegionPtr /*prgnSrc */ );
 | 
			
		||||
@@ -498,6 +502,7 @@ typedef struct _Screen {
 | 
			
		||||
    ClearToBackgroundProcPtr ClearToBackground;
 | 
			
		||||
    ClipNotifyProcPtr ClipNotify;
 | 
			
		||||
    RestackWindowProcPtr RestackWindow;
 | 
			
		||||
    PaintWindowProcPtr PaintWindow;
 | 
			
		||||
 | 
			
		||||
    /* Pixmap procedures */
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -268,10 +268,11 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
 | 
			
		||||
        RegionTranslate(&rgnExposed, pDstDrawable->x, pDstDrawable->y);
 | 
			
		||||
 | 
			
		||||
        if (extents) {
 | 
			
		||||
            /* miPaintWindow doesn't clip, so we have to */
 | 
			
		||||
            /* PaintWindow doesn't clip, so we have to */
 | 
			
		||||
            RegionIntersect(&rgnExposed, &rgnExposed, &pWin->clipList);
 | 
			
		||||
        }
 | 
			
		||||
        miPaintWindow((WindowPtr) pDstDrawable, &rgnExposed, PW_BACKGROUND);
 | 
			
		||||
        pDstDrawable->pScreen->PaintWindow((WindowPtr) pDstDrawable,
 | 
			
		||||
                                           &rgnExposed, PW_BACKGROUND);
 | 
			
		||||
 | 
			
		||||
        if (extents) {
 | 
			
		||||
            RegionReset(&rgnExposed, &expBox);
 | 
			
		||||
@@ -383,16 +384,14 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn)
 | 
			
		||||
             * work overall, on both client and server.  This is cheating, but
 | 
			
		||||
             * isn't prohibited by the protocol ("spontaneous combustion" :-).
 | 
			
		||||
             */
 | 
			
		||||
            BoxRec box;
 | 
			
		||||
 | 
			
		||||
            box = *RegionExtents(prgn);
 | 
			
		||||
            BoxRec box = *RegionExtents(prgn);
 | 
			
		||||
            exposures = &expRec;
 | 
			
		||||
            RegionInit(exposures, &box, 1);
 | 
			
		||||
            RegionReset(prgn, &box);
 | 
			
		||||
            /* miPaintWindow doesn't clip, so we have to */
 | 
			
		||||
            RegionIntersect(prgn, prgn, &pWin->clipList);
 | 
			
		||||
        }
 | 
			
		||||
        miPaintWindow(pWin, prgn, PW_BACKGROUND);
 | 
			
		||||
        pWin->drawable.pScreen->PaintWindow(pWin, prgn, PW_BACKGROUND);
 | 
			
		||||
        if (clientInterested)
 | 
			
		||||
            miSendExposures(pWin, exposures,
 | 
			
		||||
                            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
 | 
			
		||||
miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
 | 
			
		||||
{
 | 
			
		||||
@@ -437,19 +428,6 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
 | 
			
		||||
    Bool solid = TRUE;
 | 
			
		||||
    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) {
 | 
			
		||||
        while (pWin->backgroundState == ParentRelative)
 | 
			
		||||
            pWin = pWin->parent;
 | 
			
		||||
 
 | 
			
		||||
@@ -844,7 +844,7 @@ miOverlayHandleExposures(WindowPtr pWin)
 | 
			
		||||
            if ((mival = pTree->valdata)) {
 | 
			
		||||
                if (!((*pPriv->InOverlay) (pTree->pWin))) {
 | 
			
		||||
                    if (RegionNotEmpty(&mival->borderExposed)) {
 | 
			
		||||
                        miPaintWindow(pTree->pWin, &mival->borderExposed,
 | 
			
		||||
                        pScreen->PaintWindow(pTree->pWin, &mival->borderExposed,
 | 
			
		||||
                                             PW_BORDER);
 | 
			
		||||
                    }
 | 
			
		||||
                    RegionUninit(&mival->borderExposed);
 | 
			
		||||
@@ -883,7 +883,8 @@ miOverlayHandleExposures(WindowPtr pWin)
 | 
			
		||||
            }
 | 
			
		||||
            else {
 | 
			
		||||
                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);
 | 
			
		||||
            }
 | 
			
		||||
@@ -982,6 +983,7 @@ static void
 | 
			
		||||
miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn)
 | 
			
		||||
{
 | 
			
		||||
    RegionPtr exposures = prgn;
 | 
			
		||||
    ScreenPtr pScreen = pWin->drawable.pScreen;
 | 
			
		||||
 | 
			
		||||
    if (prgn && !RegionNil(prgn)) {
 | 
			
		||||
        RegionRec expRec;
 | 
			
		||||
@@ -1007,7 +1009,7 @@ miOverlayWindowExposures(WindowPtr pWin, RegionPtr prgn)
 | 
			
		||||
            else
 | 
			
		||||
                RegionIntersect(prgn, prgn, &pWin->clipList);
 | 
			
		||||
        }
 | 
			
		||||
        miPaintWindow(pWin, prgn, PW_BACKGROUND);
 | 
			
		||||
        pScreen->PaintWindow(pWin, prgn, PW_BACKGROUND);
 | 
			
		||||
        if (clientInterested)
 | 
			
		||||
            miSendExposures(pWin, exposures,
 | 
			
		||||
                            pWin->drawable.x, pWin->drawable.y);
 | 
			
		||||
@@ -1606,7 +1608,7 @@ miOverlayClearToBackground(WindowPtr pWin,
 | 
			
		||||
    if (generateExposures)
 | 
			
		||||
        (*pScreen->WindowExposures) (pWin, ®);
 | 
			
		||||
    else if (pWin->backgroundState != None)
 | 
			
		||||
        miPaintWindow(pWin, ®, PW_BACKGROUND);
 | 
			
		||||
        pScreen->PaintWindow(pWin, ®, PW_BACKGROUND);
 | 
			
		||||
    RegionUninit(®);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -253,6 +253,7 @@ miScreenInit(ScreenPtr pScreen, void *pbits,  /* pointer to screen bits */
 | 
			
		||||
    pScreen->ClearToBackground = miClearToBackground;
 | 
			
		||||
    pScreen->ClipNotify = (ClipNotifyProcPtr) 0;
 | 
			
		||||
    pScreen->RestackWindow = (RestackWindowProcPtr) 0;
 | 
			
		||||
    pScreen->PaintWindow = miPaintWindow;
 | 
			
		||||
    /* CreatePixmap, DestroyPixmap */
 | 
			
		||||
    /* RealizeFont, UnrealizeFont */
 | 
			
		||||
    /* CreateGC */
 | 
			
		||||
 
 | 
			
		||||
@@ -113,7 +113,7 @@ miClearToBackground(WindowPtr pWin,
 | 
			
		||||
    if (generateExposures)
 | 
			
		||||
        (*pWin->drawable.pScreen->WindowExposures) (pWin, ®);
 | 
			
		||||
    else if (pWin->backgroundState != None)
 | 
			
		||||
        miPaintWindow(pWin, ®, PW_BACKGROUND);
 | 
			
		||||
        pWin->drawable.pScreen->PaintWindow(pWin, ®, PW_BACKGROUND);
 | 
			
		||||
    RegionUninit(®);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -219,7 +219,9 @@ miHandleValidateExposures(WindowPtr pWin)
 | 
			
		||||
    while (1) {
 | 
			
		||||
        if ((val = pChild->valdata)) {
 | 
			
		||||
            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);
 | 
			
		||||
            (*WindowExposures) (pChild, &val->after.exposed);
 | 
			
		||||
            RegionUninit(&val->after.exposed);
 | 
			
		||||
 
 | 
			
		||||
@@ -94,6 +94,7 @@ typedef struct _RootlessScreenRec {
 | 
			
		||||
    ChangeBorderWidthProcPtr ChangeBorderWidth;
 | 
			
		||||
    PositionWindowProcPtr PositionWindow;
 | 
			
		||||
    ChangeWindowAttributesProcPtr ChangeWindowAttributes;
 | 
			
		||||
    PaintWindowProcPtr PaintWindow;
 | 
			
		||||
 | 
			
		||||
    CreateGCProcPtr CreateGC;
 | 
			
		||||
    CopyWindowProcPtr CopyWindow;
 | 
			
		||||
 
 | 
			
		||||
@@ -473,7 +473,7 @@ expose_1(WindowPtr pWin)
 | 
			
		||||
    if (!pWin->realized)
 | 
			
		||||
        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
 | 
			
		||||
       include subwindow visibility. But I'm not so sure.. so we may
 | 
			
		||||
@@ -669,6 +669,7 @@ RootlessWrap(ScreenPtr pScreen)
 | 
			
		||||
    WRAP(CloseScreen);
 | 
			
		||||
    WRAP(CreateGC);
 | 
			
		||||
    WRAP(CopyWindow);
 | 
			
		||||
    WRAP(PaintWindow);
 | 
			
		||||
    WRAP(GetImage);
 | 
			
		||||
    WRAP(SourceValidate);
 | 
			
		||||
    WRAP(CreateWindow);
 | 
			
		||||
 
 | 
			
		||||
@@ -720,7 +720,7 @@ RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
 | 
			
		||||
/*
 | 
			
		||||
 * RootlessCopyWindow
 | 
			
		||||
 *  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.
 | 
			
		||||
 *  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");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -48,6 +48,7 @@ Bool RootlessUnrealizeWindow(WindowPtr pWin);
 | 
			
		||||
void RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib);
 | 
			
		||||
void RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
 | 
			
		||||
                        RegionPtr prgnSrc);
 | 
			
		||||
void RootlessPaintWindow(WindowPtr pWin, RegionPtr prgn, int what);
 | 
			
		||||
void RootlessMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pSib,
 | 
			
		||||
                        VTKind kind);
 | 
			
		||||
void RootlessResizeWindow(WindowPtr pWin, int x, int y, unsigned int w,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user