diff options
author | Adam Jackson <ajax@redhat.com> | 2016-12-06 14:11:11 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2017-01-11 15:00:47 -0500 |
commit | 543287e60af5e9d91b5fc7e4a42e51eafa63db21 (patch) | |
tree | 94211b2bb70c1829691baf66160db7fd03a349b7 /composite/compwindow.c | |
parent | c24c9cc956038a61922f8b11ee68b8b0fc6b9f83 (diff) |
composite: Fix repaint of borders (v2)
When going from border width zero to a non-zero border width, the
Composite extension is informed via the ConfigNotify callback. The
call-chain looks like this: compConfigNotify -> compReallocPixmap ->
compSetPixmap -> TraverseTree -> compSetPixmapVisitWindow. However, at
this time, pWindow->borderWidth was not yet updated. Thus, HasBorder()
is false and the window border will not be repainted.
To fix this, thread the new bw through to the window visitor, and
inspect that rather than HasBorder(). For the other callers of
compSetPixmap the border does not change size, so we can pass
pWin->borderWidth instead.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98499
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f31875510d818ba517f082e124adb294db906e51)
Diffstat (limited to 'composite/compwindow.c')
-rw-r--r-- | composite/compwindow.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/composite/compwindow.c b/composite/compwindow.c index 344138ad7..bcd230c37 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -89,6 +89,7 @@ compCheckTree(ScreenPtr pScreen) typedef struct _compPixmapVisit { WindowPtr pWindow; PixmapPtr pPixmap; + int bw; } CompPixmapVisitRec, *CompPixmapVisitPtr; static Bool @@ -126,19 +127,20 @@ compSetPixmapVisitWindow(WindowPtr pWindow, void *data) */ SetWinSize(pWindow); SetBorderSize(pWindow); - if (HasBorder(pWindow)) + if (pVisit->bw) QueueWorkProc(compRepaintBorder, serverClient, (void *) (intptr_t) pWindow->drawable.id); return WT_WALKCHILDREN; } void -compSetPixmap(WindowPtr pWindow, PixmapPtr pPixmap) +compSetPixmap(WindowPtr pWindow, PixmapPtr pPixmap, int bw) { CompPixmapVisitRec visitRec; visitRec.pWindow = pWindow; visitRec.pPixmap = pPixmap; + visitRec.bw = bw; TraverseTree(pWindow, compSetPixmapVisitWindow, (void *) &visitRec); compCheckTree(pWindow->drawable.pScreen); } @@ -463,7 +465,8 @@ compReparentWindow(WindowPtr pWin, WindowPtr pPriorParent) * Reset pixmap pointers as appropriate */ if (pWin->parent && pWin->redirectDraw == RedirectDrawNone) - compSetPixmap(pWin, (*pScreen->GetWindowPixmap) (pWin->parent)); + compSetPixmap(pWin, (*pScreen->GetWindowPixmap) (pWin->parent), + pWin->borderWidth); /* * Call down to next function */ |