summaryrefslogtreecommitdiff
path: root/composite
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-03-26 20:18:18 -0700
committerEric Anholt <eric@anholt.net>2007-03-27 17:31:39 -0700
commit5e7936371c9e1ac48e19bf1e9e3f71f037fd9b5d (patch)
treeae6a874a0852411d7944406c0cc9a56f2010b436 /composite
parent8afc7e2eb3ebec48d3879bf269143259c8bc18c8 (diff)
Disable Composite when the screen's visual is pseudocolor.
Rendering fails badly in this case, and I don't care enough to fix it.
Diffstat (limited to 'composite')
-rw-r--r--composite/compext.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/composite/compext.c b/composite/compext.c
index 3a9f896df..af05b4a65 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -678,9 +678,22 @@ CompositeExtensionInit (void)
ExtensionEntry *extEntry;
int s;
- /* Ensure that Render is initialized on all screens. */
for (s = 0; s < screenInfo.numScreens; s++) {
- if (GetPictureScreenIfSet(screenInfo.screens[s]) == NULL)
+ ScreenPtr pScreen = screenInfo.screens[s];
+ VisualPtr vis;
+
+ /* Composite on 8bpp pseudocolor root windows appears to fail, so
+ * just disable it on anything pseudocolor for safety.
+ */
+ for (vis = pScreen->visuals; vis->vid != pScreen->rootVisual; vis++)
+ ;
+ if ((vis->class | DynamicClass) == PseudoColor)
+ return;
+
+ /* Ensure that Render is initialized, which is required for automatic
+ * compositing.
+ */
+ if (GetPictureScreenIfSet(pScreen) == NULL)
return;
}