Redraw window borders when switching window pixmaps around

Make cw "own" the window pixmaps by wrapping
    GetWindowPixmap/SetWindowPixmap.
This commit is contained in:
Keith Packard 2004-08-15 00:43:39 +00:00
commit 9433085179
4 changed files with 69 additions and 14 deletions

View file

@ -69,6 +69,23 @@ typedef struct _compPixmapVisit {
PixmapPtr pPixmap;
} CompPixmapVisitRec, *CompPixmapVisitPtr;
static Bool
compRepaintBorder (ClientPtr pClient, pointer closure)
{
WindowPtr pWindow = LookupWindow ((XID) closure, pClient);
if (pWindow)
{
RegionRec exposed;
REGION_NULL(pScreen, &exposed);
REGION_SUBTRACT(pScreen, &exposed, &pWindow->borderClip, &pWindow->winSize);
(*pWindow->drawable.pScreen->PaintWindowBorder)(pWindow, &exposed, PW_BORDER);
REGION_UNINIT(pScreen, &exposed);
}
return TRUE;
}
static int
compSetPixmapVisitWindow (WindowPtr pWindow, pointer data)
{
@ -85,6 +102,9 @@ compSetPixmapVisitWindow (WindowPtr pWindow, pointer data)
*/
SetWinSize (pWindow);
SetBorderSize (pWindow);
if (HasBorder (pWindow))
QueueWorkProc (compRepaintBorder, serverClient,
(pointer) pWindow->drawable.id);
return WT_WALKCHILDREN;
}