ecore imf - fix modules that are x11 based to only load in x11 and in wl

use env vars to determine module init for ecore-imf so you don't have
things like e locking up trying to init scim when running in wl mode.
do the same for ibus and xim modules too. do the inverse for wayland
imf module but here add also the check for ELM_DISPLAY that wasn't
there (like it is now in the other modules) so it is only initted on
wayland.

@fix
This commit is contained in:
Carsten Haitzler 2015-10-31 11:35:19 +09:00
parent 081e9894d4
commit 14d5fde2d7
4 changed files with 29 additions and 3 deletions

View File

@ -65,7 +65,14 @@ static Ecore_IMF_Context *im_module_exit (void);
static Eina_Bool
im_module_init(void)
{
ecore_main_loop_glib_integrate();
const char *s;
if (!getenv("DISPLAY")) return EINA_FALSE;
if ((s = getenv("ELM_DISPLAY")))
{
if (strcmp(s, "x11")) return EINA_FALSE;
}
ecore_main_loop_glib_integrate();
ibus_init();
ecore_imf_module_register(&ibus_im_info, im_module_create, im_module_exit);

View File

@ -57,6 +57,13 @@ extern "C"
static Eina_Bool imf_module_init (void)
{
const char *s;
if (!getenv("DISPLAY")) return EINA_FALSE;
if ((s = getenv("ELM_DISPLAY")))
{
if (strcmp(s, "x11")) return EINA_FALSE;
}
ecore_imf_module_register (&isf_imf_info, imf_module_create, imf_module_exit);
return EINA_TRUE;
}

View File

@ -145,11 +145,16 @@ im_module_create()
static Eina_Bool
im_module_init(void)
{
const char *s;
_ecore_imf_wayland_log_dom =
eina_log_domain_register("ecore_imf_wayland", EINA_COLOR_YELLOW);
if (!getenv("WAYLAND_DISPLAY"))
return EINA_FALSE;
if (!getenv("WAYLAND_DISPLAY")) return EINA_FALSE;
if ((s = getenv("ELM_DISPLAY")))
{
if (strcmp(s, "wl")) return EINA_FALSE;
}
if (!ecore_wl_init(NULL))
return EINA_FALSE;

View File

@ -754,6 +754,13 @@ xim_imf_module_exit(void)
static Eina_Bool
_ecore_imf_xim_init(void)
{
const char *s;
if (!getenv("DISPLAY")) return EINA_FALSE;
if ((s = getenv("ELM_DISPLAY")))
{
if (strcmp(s, "x11")) return EINA_FALSE;
}
eina_init();
_ecore_imf_xim_log_dom = eina_log_domain_register("ecore_imf_xim", NULL);