From 5298ac3264bf576d5bf9cf429ca5f429a5752ebf Mon Sep 17 00:00:00 2001 From: sachiel Date: Sat, 3 Jan 2009 21:53:42 +0000 Subject: [PATCH] Ugly. But apparently Solaris does not have the Xutf8* functions git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@38443 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_x/xlib/ecore_x_events.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_x/xlib/ecore_x_events.c b/src/lib/ecore_x/xlib/ecore_x_events.c index f73651e..87b7208 100644 --- a/src/lib/ecore_x/xlib/ecore_x_events.c +++ b/src/lib/ecore_x/xlib/ecore_x_events.c @@ -217,17 +217,29 @@ _ecore_x_event_handle_key_press(XEvent *xevent) if (_ecore_x_ic) { Status mbstatus; +#ifdef X_HAVE_UTF8_STRING val = Xutf8LookupString(_ecore_x_ic, (XKeyEvent *)xevent, buf, buflen - 1, &sym, &mbstatus); +#else + val = XmbLookupString(_ecore_x_ic, (XKeyEvent *)xevent, buf, buflen - 1, &sym, &mbstatus); +#endif if (mbstatus == XBufferOverflow) { buflen = val + 1; buf = realloc(buf, buflen); +#ifdef X_HAVE_UTF8_STRING val = Xutf8LookupString(_ecore_x_ic, (XKeyEvent *)xevent, buf, buflen - 1, &sym, &mbstatus); +#else + val = XmbLookupString(_ecore_x_ic, (XKeyEvent *)xevent, buf, buflen - 1, &sym, &mbstatus); +#endif } if (val > 0) { buf[val] = 0; +#ifdef X_HAVE_UTF8_STRING e->key_compose = strdup(buf); +#else + e->key_compose = ecore_txt_convert(nl_langinfo(CODESET), "UTF-8", buf); +#endif } } else @@ -739,7 +751,7 @@ _ecore_x_event_handle_focus_in(XEvent *xevent) { char *str; XSetICValues(_ecore_x_ic, XNFocusWindow, xevent->xfocus.window, NULL); - if ((str = Xutf8ResetIC(_ecore_x_ic))) + if ((str = Xmb8ResetIC(_ecore_x_ic))) XFree(str); XSetICFocus(_ecore_x_ic); } -- 2.7.4