ecore_imf: just use the styles that are supported!

If we want a fancy XIM style that is unsupported, do not use it... but
the fallback (no preedit, no status).

This allows poor's man XIM to work for those without SCIM and similar.

Elementary is now working properly with ' + a = á



SVN revision: 72426
This commit is contained in:
Gustavo Sverzut Barbieri 2012-06-18 23:38:23 +00:00
parent 3e5a5aac7b
commit 2a187d3abe
1 changed files with 42 additions and 1 deletions

View File

@ -1226,7 +1226,48 @@ get_ic(Ecore_IMF_Context *ctx)
im_style |= XIMStatusNothing;
}
if (im_info->im)
if (!im_info->xim_styles)
{
EINA_LOG_WARN("No XIM styles supported! Wanted %#llx",
(unsigned long long)im_style);
im_style = 0;
}
else
{
XIMStyle fallback = 0;
int i;
for (i = 0; i < im_info->xim_styles->count_styles; i++)
{
XIMStyle cur = im_info->xim_styles->supported_styles[i];
if (cur == im_style)
break;
else if (cur == (XIMPreeditNothing | XIMStatusNothing))
/* TODO: fallback is just that or the anyone? */
fallback = cur;
}
if (i == im_info->xim_styles->count_styles)
{
if (fallback)
{
EINA_LOG_WARN("Wanted XIM style %#llx not found, "
"using fallback %#llx instead.",
(unsigned long long)im_style,
(unsigned long long)fallback);
im_style = fallback;
}
else
{
EINA_LOG_WARN("Wanted XIM style %#llx not found, "
"no fallback supported.",
(unsigned long long)im_style);
im_style = 0;
}
}
}
if ((im_info->im) && (im_style))
{
ic = XCreateIC(im_info->im,
XNInputStyle, im_style,