Mercurial > sdl-ios-xcode
diff src/video/x11/SDL_x11video.c @ 4014:a6264945ac52 SDL-1.2
Fixed compiler warning (gcc w/ -Wall) for unused variable, and checked for
error return code too.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sun, 08 Jul 2007 01:35:50 +0000 |
parents | a19fd8bcdd52 |
children | 3f93ccc2c01e |
line wrap: on
line diff
--- a/src/video/x11/SDL_x11video.c Sat Jul 07 19:22:27 2007 +0000 +++ b/src/video/x11/SDL_x11video.c Sun Jul 08 01:35:50 2007 +0000 @@ -538,8 +538,17 @@ whenever we re-create an IC. */ unsigned long mask = 0; char *ret = pXGetICValues(SDL_IC, XNFilterEvents, &mask, NULL); - XSelectInput(SDL_Display, WMwindow, app_event_mask | mask); - XSetICFocus(SDL_IC); + if (ret != NULL) { + XUnsetICFocus(SDL_IC); + XDestroyIC(SDL_IC); + SDL_IC = NULL; + SDL_SetError("no input context could be created"); + XCloseIM(SDL_IM); + SDL_IM = NULL; + } else { + XSelectInput(SDL_Display, WMwindow, app_event_mask | mask); + XSetICFocus(SDL_IC); + } } } }