src/video/x11/SDL_x11window.c
changeset 2945 e38423786728
parent 2942 1e431c2631ee
child 2967 e4a469d6ddab
--- a/src/video/x11/SDL_x11window.c	Thu Jan 01 18:49:43 2009 +0000
+++ b/src/video/x11/SDL_x11window.c	Thu Jan 01 18:58:26 2009 +0000
@@ -212,7 +212,7 @@
     xattr.background_pixel = 0;
     xattr.border_pixel = 0;
 
-    if (visual->class == DirectColor || visual->class == PseudoColor) {
+    if (visual->class == PseudoColor) {
         int nmaps;
         XStandardColormap cmap;
         XStandardColormap *stdmaps;
@@ -299,6 +299,12 @@
             X11_TrackColormap(data->display, displaydata->screen, colormap,
                               &cmap, visual);
         }
+    } else if (visual->class == DirectColor) {
+        /* FIXME: Allocate a read-write colormap for gamma fading someday */
+        xattr.colormap =
+            XCreateColormap(data->display,
+                            RootWindow(data->display, displaydata->screen),
+                            visual, AllocNone);
     } else {
         xattr.colormap =
             XCreateColormap(data->display,