From: sachiel Date: Sat, 3 Jan 2009 21:53:42 +0000 (+0000) Subject: Ugly. But apparently Solaris does not have the Xutf8* functions X-Git-Tag: 2.0_alpha~194^2~1676 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5298ac3264bf576d5bf9cf429ca5f429a5752ebf;p=framework%2Fuifw%2Fecore.git 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 --- 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); }