composite: Automatically enable backing store support on the screen
authorAdam Jackson <ajax@redhat.com>
Tue, 5 Nov 2013 15:08:17 +0000 (10:08 -0500)
committerAdam Jackson <ajax@redhat.com>
Mon, 9 Dec 2013 18:20:36 +0000 (13:20 -0500)
... unless you explicitly disabled it with -bs on the command line, or
with the corresponding thing in xorg.conf.

v2: Drop a bogus hunk from compChangeWindowAttributes [vsyrjala]
v3: s/TRUE/WhenMapped/ [jcristau]

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

index bc1130e..6431464 100644 (file)
@@ -355,6 +355,9 @@ compScreenInit(ScreenPtr pScreen)
         return FALSE;
     }
 
+    if (!disableBackingStore)
+        pScreen->backingStoreSupport = WhenMapped;
+
     cs->PositionWindow = pScreen->PositionWindow;
     pScreen->PositionWindow = compPositionWindow;
 
index 4f1f3d4..f1e6783 100644 (file)
@@ -1638,6 +1638,11 @@ xf86SetBackingStore(ScreenPtr pScreen)
     else {
         if (xf86GetOptValBool(options, OPTION_BACKING_STORE, &useBS))
             from = X_CONFIG;
+#ifdef COMPOSITE
+        if (from != X_CONFIG)
+            useBS = xf86ReturnOptValBool(options, OPTION_BACKING_STORE,
+                                         !noCompositeExtension);
+#endif
     }
     free(options);
     pScreen->backingStoreSupport = useBS ? WhenMapped : NotUseful;