src/video/x11/SDL_x11video.c
branchSDL-1.2
changeset 4014 a6264945ac52
parent 4008 a19fd8bcdd52
child 4016 3f93ccc2c01e
equal deleted inserted replaced
4013:5804139bdf0b 4014:a6264945ac52
   536 				   xlib specification allows IM to change the event requirement
   536 				   xlib specification allows IM to change the event requirement
   537 				   with its own circumstances, it is safe to call SelectInput
   537 				   with its own circumstances, it is safe to call SelectInput
   538 				   whenever we re-create an IC.  */
   538 				   whenever we re-create an IC.  */
   539 				unsigned long mask = 0;
   539 				unsigned long mask = 0;
   540 				char *ret = pXGetICValues(SDL_IC, XNFilterEvents, &mask, NULL);
   540 				char *ret = pXGetICValues(SDL_IC, XNFilterEvents, &mask, NULL);
   541 				XSelectInput(SDL_Display, WMwindow, app_event_mask | mask);
   541 				if (ret != NULL) {
   542 				XSetICFocus(SDL_IC);
   542 					XUnsetICFocus(SDL_IC);
       
   543 					XDestroyIC(SDL_IC);
       
   544 					SDL_IC = NULL;
       
   545 					SDL_SetError("no input context could be created");
       
   546 					XCloseIM(SDL_IM);
       
   547 					SDL_IM = NULL;
       
   548 				} else {
       
   549 					XSelectInput(SDL_Display, WMwindow, app_event_mask | mask);
       
   550 					XSetICFocus(SDL_IC);
       
   551 				}
   543 			}
   552 			}
   544 		}
   553 		}
   545 	}
   554 	}
   546 	#endif
   555 	#endif
   547 
   556