public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michael Sterrett (mr_bones_)" <mr_bones_@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in media-libs/libsdl/files: libsdl-1.2.15-SDL_EnableUNICODE.patch
Date: Tue, 12 May 2015 19:56:33 +0000 (UTC)	[thread overview]
Message-ID: <20150512195633.A599B9E5@oystercatcher.gentoo.org> (raw)

mr_bones_    15/05/12 19:56:33

  Added:                libsdl-1.2.15-SDL_EnableUNICODE.patch
  Log:
  add backported patch from upstream report by Rafał Mużyło via bug #499180 to fix input in some conditions
  
  (Portage version: 2.2.18/cvs/Linux x86_64, unsigned Manifest commit)

Revision  Changes    Path
1.1                  media-libs/libsdl/files/libsdl-1.2.15-SDL_EnableUNICODE.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libsdl/files/libsdl-1.2.15-SDL_EnableUNICODE.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/libsdl/files/libsdl-1.2.15-SDL_EnableUNICODE.patch?rev=1.1&content-type=text/plain

Index: libsdl-1.2.15-SDL_EnableUNICODE.patch
===================================================================

diff -r 22a7f096bb9d -r 0aade9c0203f src/video/x11/SDL_x11events.c
--- a/src/video/x11/SDL_x11events.c	Sun Dec 01 00:00:17 2013 -0500
+++ b/src/video/x11/SDL_x11events.c	Thu Apr 17 22:36:14 2014 -0700
@@ -395,6 +395,8 @@
 {
 	int posted;
 	XEvent xevent;
+	int orig_event_type;
+	KeyCode orig_keycode;
 
 	SDL_memset(&xevent, '\0', sizeof (XEvent));  /* valgrind fix. --ryan. */
 	XNextEvent(SDL_Display, &xevent);
@@ -410,9 +412,29 @@
 #ifdef X_HAVE_UTF8_STRING
 	/* If we are translating with IM, we need to pass all events
 	   to XFilterEvent, and discard those filtered events immediately.  */
+	orig_event_type = xevent.type;
+	if (orig_event_type == KeyPress || orig_event_type == KeyRelease) {
+	     orig_keycode = xevent.xkey.keycode;
+	} else {
+	     orig_keycode = 0;
+	}
 	if ( SDL_TranslateUNICODE
 	     && SDL_IM != NULL
 	     && XFilterEvent(&xevent, None) ) {
+	        if (orig_keycode) {
+	            SDL_keysym keysym;
+	            static XComposeStatus state;
+	            char keybuf[32];
+
+	            keysym.scancode = xevent.xkey.keycode;
+	            keysym.sym = X11_TranslateKeycode(SDL_Display, xevent.xkey.keycode);
+	            keysym.mod = KMOD_NONE;
+	            keysym.unicode = 0;
+	            if (orig_event_type == KeyPress && XLookupString(&xevent.xkey, keybuf, sizeof(keybuf), NULL, &state))
+	                keysym.unicode = (Uint8)keybuf[0];
+
+	            SDL_PrivateKeyboard(orig_event_type == KeyPress ? SDL_PRESSED : SDL_RELEASED, &keysym);
+	        }
 		return 0;
 	}
 #endif









                 reply	other threads:[~2015-05-12 19:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150512195633.A599B9E5@oystercatcher.gentoo.org \
    --to=mr_bones_@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox