From d755b57f89a267e29df50239e86645714bce7d02 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 11 Oct 2012 14:42:49 -0700 Subject: [PATCH 1/2] Added missing X11 call XUninstallColormap() --- src/video/x11/SDL_x11sym.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index d2b8fc287..9449849bd 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -110,6 +110,7 @@ SDL_X11_SYM(int,XUndefineCursor,(Display* a,Window b),(a,b),return) SDL_X11_SYM(int,XUngrabKeyboard,(Display* a,Time b),(a,b),return) SDL_X11_SYM(int,XUngrabPointer,(Display* a,Time b),(a,b),return) SDL_X11_SYM(int,XUngrabServer,(Display* a),(a),return) +SDL_X11_SYM(int,XUninstallColormap,(Display* a,Colormap b),(a,b),return) SDL_X11_SYM(int,XUnmapWindow,(Display* a,Window b),(a,b),return) SDL_X11_SYM(int,XWarpPointer,(Display* a,Window b,Window c,int d,int e,unsigned int f,unsigned int g,int h,int i),(a,b,c,d,e,f,g,h,i),return) SDL_X11_SYM(VisualID,XVisualIDFromVisual,(Visual* a),(a),return) From ad7cbfbecc6e525c27da41e44027dfda0085d7ab Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 11 Oct 2012 14:43:13 -0700 Subject: [PATCH 2/2] 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); }