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 6575833a983f218e
parent 6574 e2e95c906d44
child 6576 028529a31bc4
Only install/uninstall the colormap if we've created a DirectColor colormap.
src/video/x11/SDL_x11window.c
     1.1 --- a/src/video/x11/SDL_x11window.c	Thu Oct 11 14:42:49 2012 -0700
     1.2 +++ b/src/video/x11/SDL_x11window.c	Thu Oct 11 14:43:13 2012 -0700
     1.3 @@ -993,11 +993,13 @@
     1.4          X11_SetNetWMState(_this, data->xwindow, flags);
     1.5      }
     1.6  
     1.7 -	if( fullscreen ) {
     1.8 -		XInstallColormap(display, data->colormap);
     1.9 -	} else {
    1.10 -		XUninstallColormap(display, data->colormap);
    1.11 -	}
    1.12 +    if (data->visual->class == DirectColor) {
    1.13 +        if ( fullscreen ) {
    1.14 +            XInstallColormap(display, data->colormap);
    1.15 +        } else {
    1.16 +            XUninstallColormap(display, data->colormap);
    1.17 +        }
    1.18 +    }
    1.19  
    1.20      XFlush(display);
    1.21  }