Fixed compiler warning (gcc w/ -Wall) for unused variable, and checked for SDL-1.2
authorRyan C. Gordon
Sun, 08 Jul 2007 01:35:50 +0000
branchSDL-1.2
changeset 4014a6264945ac52
parent 4013 5804139bdf0b
child 4015 7e878cc4250a
Fixed compiler warning (gcc w/ -Wall) for unused variable, and checked for
error return code too.
src/video/x11/SDL_x11video.c
     1.1 --- a/src/video/x11/SDL_x11video.c	Sat Jul 07 19:22:27 2007 +0000
     1.2 +++ b/src/video/x11/SDL_x11video.c	Sun Jul 08 01:35:50 2007 +0000
     1.3 @@ -538,8 +538,17 @@
     1.4  				   whenever we re-create an IC.  */
     1.5  				unsigned long mask = 0;
     1.6  				char *ret = pXGetICValues(SDL_IC, XNFilterEvents, &mask, NULL);
     1.7 -				XSelectInput(SDL_Display, WMwindow, app_event_mask | mask);
     1.8 -				XSetICFocus(SDL_IC);
     1.9 +				if (ret != NULL) {
    1.10 +					XUnsetICFocus(SDL_IC);
    1.11 +					XDestroyIC(SDL_IC);
    1.12 +					SDL_IC = NULL;
    1.13 +					SDL_SetError("no input context could be created");
    1.14 +					XCloseIM(SDL_IM);
    1.15 +					SDL_IM = NULL;
    1.16 +				} else {
    1.17 +					XSelectInput(SDL_Display, WMwindow, app_event_mask | mask);
    1.18 +					XSetICFocus(SDL_IC);
    1.19 +				}
    1.20  			}
    1.21  		}
    1.22  	}