composite: Don't double-redirect if someone asks for backing store twice
authorAdam Jackson <ajax@redhat.com>
Tue, 5 Nov 2013 15:12:28 +0000 (10:12 -0500)
committerAdam Jackson <ajax@redhat.com>
Mon, 9 Dec 2013 18:20:36 +0000 (13:20 -0500)
v2: Belt-and-suspenders the unredirection path [vsyrjala]

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
composite/compinit.c

index 6431464..3c91091 100644 (file)
@@ -117,11 +117,11 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
 
     if (ret && (mask & CWBackingStore) &&
         pScreen->backingStoreSupport != NotUseful) {
-        if (pWin->backingStore != NotUseful) {
+        if (pWin->backingStore != NotUseful && !pWin->backStorage) {
             compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
             pWin->backStorage = (pointer) (intptr_t) 1;
         }
-        else {
+        else if (pWin->backingStore == NotUseful && pWin->backStorage) {
             compUnredirectWindow(serverClient, pWin,
                                  CompositeRedirectAutomatic);
             pWin->backStorage = NULL;