[PATCH xserver] composite: Fix repaint of borders

Uli Schlachter psychon at znc.in
Sat Nov 26 17:48:02 UTC 2016


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.

Fix this by unconditionally queuing the call to compRepaintBorder().
This function is then enhanced to check if a border exists.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98499
Signed-off-by: Uli Schlachter <psychon at znc.in>
---
Please keep me CC'd to replies. Also, feel free to come up with
other/better fixes for this. :-)

 composite/compwindow.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/composite/compwindow.c b/composite/compwindow.c
index 344138a..3323df6 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -99,7 +99,7 @@ compRepaintBorder(ClientPtr pClient, void *closure)
         dixLookupWindow(&pWindow, (XID) (intptr_t) closure, pClient,
                         DixWriteAccess);
 
-    if (rc == Success) {
+    if (rc == Success && HasBorder(pWindow)) {
         RegionRec exposed;
 
         RegionNull(&exposed);
@@ -126,9 +126,8 @@ compSetPixmapVisitWindow(WindowPtr pWindow, void *data)
      */
     SetWinSize(pWindow);
     SetBorderSize(pWindow);
-    if (HasBorder(pWindow))
-        QueueWorkProc(compRepaintBorder, serverClient,
-                      (void *) (intptr_t) pWindow->drawable.id);
+    QueueWorkProc(compRepaintBorder, serverClient,
+                  (void *) (intptr_t) pWindow->drawable.id);
     return WT_WALKCHILDREN;
 }
 
-- 
2.10.2



More information about the xorg-devel mailing list