Only install/uninstall the colormap if we've created a DirectColor colormap.
authorSam Lantinga <slouken@libsdl.org>
Thu, 11 Oct 2012 14:43:13 -0700
changeset 6575 833a983f218e
parent 6574 e2e95c906d44
child 6576 028529a31bc4
Only install/uninstall the colormap if we've created a DirectColor colormap.
src/video/x11/SDL_x11window.c
--- a/src/video/x11/SDL_x11window.c	Thu Oct 11 14:42:49 2012 -0700
+++ b/src/video/x11/SDL_x11window.c	Thu Oct 11 14:43:13 2012 -0700
@@ -993,11 +993,13 @@
         X11_SetNetWMState(_this, data->xwindow, flags);
     }
 
-	if( fullscreen ) {
-		XInstallColormap(display, data->colormap);
-	} else {
-		XUninstallColormap(display, data->colormap);
-	}
+    if (data->visual->class == DirectColor) {
+        if ( fullscreen ) {
+            XInstallColormap(display, data->colormap);
+        } else {
+            XUninstallColormap(display, data->colormap);
+        }
+    }
 
     XFlush(display);
 }