diff options
author | Adam Jackson <ajax@redhat.com> | 2015-06-02 13:58:30 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2015-07-08 16:41:28 -0400 |
commit | cbd3cfbad3f07b20e90ea9498110f255813eb441 (patch) | |
tree | 18ea660c0d607e33d059f262d68e562c9771fc12 | |
parent | 74d64ceea02bffad1caf3d1a727edbd38d968059 (diff) |
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>
-rw-r--r-- | composite/compwindow.c | 2 | ||||
-rw-r--r-- | dix/window.c | 4 | ||||
-rw-r--r-- | hw/xquartz/quartz.c | 4 | ||||
-rw-r--r-- | hw/xwin/winrandr.c | 2 | ||||
-rw-r--r-- | include/scrnintstr.h | 5 | ||||
-rw-r--r-- | mi/miexpose.c | 32 | ||||
-rw-r--r-- | mi/mioverlay.c | 12 | ||||
-rw-r--r-- | mi/miscrinit.c | 1 | ||||
-rw-r--r-- | mi/miwindow.c | 6 | ||||
-rw-r--r-- | miext/rootless/rootlessCommon.h | 1 | ||||
-rw-r--r-- | miext/rootless/rootlessScreen.c | 3 | ||||
-rw-r--r-- | miext/rootless/rootlessWindow.c | 23 | ||||
-rw-r--r-- | miext/rootless/rootlessWindow.h | 1 |
13 files changed, 54 insertions, 42 deletions
diff --git a/composite/compwindow.c b/composite/compwindow.c index 77bdfa23c..344138ad7 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -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; diff --git a/dix/window.c b/dix/window.c index 1b44305c9..d57f320f8 100644 --- a/dix/window.c +++ b/dix/window.c @@ -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, diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index 851ce4842..d3ec133f6 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -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); diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c index 73925070d..f4ba054bc 100644 --- a/hw/xwin/winrandr.c +++ b/hw/xwin/winrandr.c @@ -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); diff --git a/include/scrnintstr.h b/include/scrnintstr.h index a627fe7ac..2e617c466 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -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 */ diff --git a/mi/miexpose.c b/mi/miexpose.c index f4c6e89a0..148d1a63b 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -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; diff --git a/mi/mioverlay.c b/mi/mioverlay.c index 2b20fd72f..9f3ef0725 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -844,8 +844,8 @@ miOverlayHandleExposures(WindowPtr pWin) if ((mival = pTree->valdata)) { if (!((*pPriv->InOverlay) (pTree->pWin))) { if (RegionNotEmpty(&mival->borderExposed)) { - miPaintWindow(pTree->pWin, &mival->borderExposed, - PW_BORDER); + 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(®); } diff --git a/mi/miscrinit.c b/mi/miscrinit.c index b53c7e41a..9c6af0dc7 100644 --- a/mi/miscrinit.c +++ b/mi/miscrinit.c @@ -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 */ diff --git a/mi/miwindow.c b/mi/miwindow.c index 2fc7cfb79..39c279e18 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -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); diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h index fd9c941f4..aa5557954 100644 --- a/miext/rootless/rootlessCommon.h +++ b/miext/rootless/rootlessCommon.h @@ -94,6 +94,7 @@ typedef struct _RootlessScreenRec { ChangeBorderWidthProcPtr ChangeBorderWidth; PositionWindowProcPtr PositionWindow; ChangeWindowAttributesProcPtr ChangeWindowAttributes; + PaintWindowProcPtr PaintWindow; CreateGCProcPtr CreateGC; CopyWindowProcPtr CopyWindow; diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 6226ee84a..471656428 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -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); diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index 3240acce5..e3042990c 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -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 */ diff --git a/miext/rootless/rootlessWindow.h b/miext/rootless/rootlessWindow.h index d3955fc89..4fd34d54d 100644 --- a/miext/rootless/rootlessWindow.h +++ b/miext/rootless/rootlessWindow.h @@ -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, |