Browse Source

Fix a bug in our Xutf8LookupString() usage.

tags/v0.99.beta18
Sam Hocevar sam 14 years ago
parent
commit
9b513e786c
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      caca/driver/x11.c

+ 8
- 4
caca/driver/x11.c View File

@@ -521,6 +521,9 @@ static int x11_get_event(caca_display_t *dp, caca_privevent_t *ev)
dp->drv.p->event_mask, &xevent) == True)
{
KeySym keysym;
#if defined X_HAVE_UTF8_STRING
int len;
#endif

/* Expose event */
if(xevent.type == Expose)
@@ -602,15 +605,16 @@ static int x11_get_event(caca_display_t *dp, caca_privevent_t *ev)
continue;

#if defined X_HAVE_UTF8_STRING
if(Xutf8LookupString(dp->drv.p->ic, &xevent.xkey, ev->data.key.utf8, 8, NULL, NULL))
len = Xutf8LookupString(dp->drv.p->ic, &xevent.xkey,
ev->data.key.utf8, 8, NULL, NULL);
ev->data.key.utf8[len] = 0;
if (len)
{
ev->data.key.utf32 = caca_utf8_to_utf32(ev->data.key.utf8, NULL);
if(ev->data.key.utf32 <= 0xff)
{
ev->data.key.ch = ev->data.key.utf32;
} else {
else
ev->data.key.ch = 0;
}
return 1;
}
#endif


Loading…
Cancel
Save