Blame SOURCES/0001-dix-Optimize-setting-backing-store-state.patch

91849c
From c2c9450bc7b324e58ea6b77d0d7e1d2d18f35646 Mon Sep 17 00:00:00 2001
91849c
From: Adam Jackson <ajax@redhat.com>
91849c
Date: Tue, 30 Jul 2019 21:26:49 -0400
91849c
Subject: [PATCH xserver] dix: Optimize setting backing store state
91849c
91849c
Extra special RHEL 7.7+ edition
91849c
---
91849c
 composite/compinit.c | 15 +++++----------
91849c
 dix/window.c         |  6 ++++++
91849c
 2 files changed, 11 insertions(+), 10 deletions(-)
91849c
91849c
diff --git a/composite/compinit.c b/composite/compinit.c
91849c
index 2a4de4a22..149f354a6 100644
91849c
--- a/composite/compinit.c
91849c
+++ b/composite/compinit.c
91849c
@@ -120,20 +120,15 @@ compCheckBackingStore(WindowPtr pWin)
91849c
         (pWin->backingStore == Always) ||
91849c
         (pWin->backingStore == WhenMapped && pWin->viewable);
91849c
 
91849c
-    if (should && !pWin->backStorage) {
91849c
+    if (should) {
91849c
         compCheckPaintable(pWin);
91849c
-        if (Success == compRedirectWindow(serverClient, pWin,
91849c
-                                          CompositeRedirectAutomatic))
91849c
-            pWin->backStorage = TRUE;
91849c
+        compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
91849c
     }
91849c
-    else if (!should && pWin->backStorage) {
91849c
+    else if (!should) {
91849c
         compCheckPaintable(pWin);
91849c
-        if (Success == compUnredirectWindow(serverClient, pWin,
91849c
-                                            CompositeRedirectAutomatic))
91849c
-            pWin->backStorage = FALSE;
91849c
+        compUnredirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
91849c
     }
91849c
-    pWin->paintable = pWin->viewable ||
91849c
-        (pWin->backingStore == Always && pWin->backStorage);
91849c
+    compCheckPaintable(pWin); /* XXX before and after? really? */
91849c
 }
91849c
 
91849c
 /* Fake backing store via automatic redirection */
91849c
diff --git a/dix/window.c b/dix/window.c
91849c
index 34bed93d9..30ae5db89 100644
91849c
--- a/dix/window.c
91849c
+++ b/dix/window.c
91849c
@@ -1342,6 +1342,12 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
91849c
                 client->errorValue = val;
91849c
                 goto PatchUp;
91849c
             }
91849c
+            /* if we're not actually changing the window's state, hide
91849c
+             * CWBackingStore from vmaskCopy so it doesn't get passed to
91849c
+             * ->ChangeWindowAttributes below
91849c
+             */
91849c
+            if (pWin->backingStore == val)
91849c
+                continue;
91849c
             pWin->backingStore = val;
91849c
             pWin->forcedBS = FALSE;
91849c
             break;
91849c
-- 
91849c
2.21.0
91849c