Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 499180 | Differences between
and this patch

Collapse All | Expand All

(-)src/video/x11/SDL_x11events.c (+18 lines)
Lines 395-400 static int X11_DispatchEvent(_THIS) Link Here
395
{
395
{
396
	int posted;
396
	int posted;
397
	XEvent xevent;
397
	XEvent xevent;
398
	int orig_event_type;
399
	KeyCode orig_keycode;
398
400
399
	SDL_memset(&xevent, '\0', sizeof (XEvent));  /* valgrind fix. --ryan. */
401
	SDL_memset(&xevent, '\0', sizeof (XEvent));  /* valgrind fix. --ryan. */
400
	XNextEvent(SDL_Display, &xevent);
402
	XNextEvent(SDL_Display, &xevent);
Lines 410-418 static int X11_DispatchEvent(_THIS) Link Here
410
#ifdef X_HAVE_UTF8_STRING
412
#ifdef X_HAVE_UTF8_STRING
411
	/* If we are translating with IM, we need to pass all events
413
	/* If we are translating with IM, we need to pass all events
412
	   to XFilterEvent, and discard those filtered events immediately.  */
414
	   to XFilterEvent, and discard those filtered events immediately.  */
415
	orig_event_type = xevent.type;
416
	if (orig_event_type == KeyPress || orig_event_type == KeyRelease) {
417
	     orig_keycode = xevent.xkey.keycode;
418
	} else {
419
	     orig_keycode = 0;
420
	}
413
	if ( SDL_TranslateUNICODE
421
	if ( SDL_TranslateUNICODE
414
	     && SDL_IM != NULL
422
	     && SDL_IM != NULL
415
	     && XFilterEvent(&xevent, None) ) {
423
	     && XFilterEvent(&xevent, None) ) {
424
	        if (orig_keycode) {
425
	            SDL_keysym keysym;
426
427
	            keysym.scancode = xevent.xkey.keycode;
428
	            keysym.sym = X11_TranslateKeycode(SDL_Display, xevent.xkey.keycode);
429
	            keysym.mod = KMOD_NONE;
430
	            keysym.unicode = 0;
431
432
	            SDL_PrivateKeyboard(orig_event_type == KeyPress ? SDL_PRESSED : SDL_RELEASED, &keysym);
433
	        }
416
		return 0;
434
		return 0;
417
	}
435
	}
418
#endif
436
#endif

Return to bug 499180