From ad7cbfbecc6e525c27da41e44027dfda0085d7ab Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 11 Oct 2012 14:43:13 -0700 Subject: [PATCH] Only install/uninstall the colormap if we've created a DirectColor colormap. --- src/video/x11/SDL_x11window.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index cc6b9f5de..ba4ecc24a 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -993,11 +993,13 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis 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); }