raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=14d5fde2d72a933d7c0def7de310cdfda909602a

commit 14d5fde2d72a933d7c0def7de310cdfda909602a
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Sat Oct 31 11:35:19 2015 +0900

    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
---
 src/modules/ecore_imf/ibus/ibus_module.c       | 9 ++++++++-
 src/modules/ecore_imf/scim/scim_module.cpp     | 7 +++++++
 src/modules/ecore_imf/wayland/wayland_module.c | 9 +++++++--
 src/modules/ecore_imf/xim/ecore_imf_xim.c      | 7 +++++++
 4 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/src/modules/ecore_imf/ibus/ibus_module.c 
b/src/modules/ecore_imf/ibus/ibus_module.c
index f4e913f..ba44fdb 100644
--- a/src/modules/ecore_imf/ibus/ibus_module.c
+++ b/src/modules/ecore_imf/ibus/ibus_module.c
@@ -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);
 
diff --git a/src/modules/ecore_imf/scim/scim_module.cpp 
b/src/modules/ecore_imf/scim/scim_module.cpp
index d77fb11..12eac4f 100644
--- a/src/modules/ecore_imf/scim/scim_module.cpp
+++ b/src/modules/ecore_imf/scim/scim_module.cpp
@@ -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;
      }
diff --git a/src/modules/ecore_imf/wayland/wayland_module.c 
b/src/modules/ecore_imf/wayland/wayland_module.c
index 7f7b204..f395faa 100644
--- a/src/modules/ecore_imf/wayland/wayland_module.c
+++ b/src/modules/ecore_imf/wayland/wayland_module.c
@@ -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;
diff --git a/src/modules/ecore_imf/xim/ecore_imf_xim.c 
b/src/modules/ecore_imf/xim/ecore_imf_xim.c
index 66a355f..99213a4 100644
--- a/src/modules/ecore_imf/xim/ecore_imf_xim.c
+++ b/src/modules/ecore_imf/xim/ecore_imf_xim.c
@@ -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);

-- 


Reply via email to