ecore_imf: init wayland before using wayland calls.
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>
Tue, 21 Apr 2015 14:06:38 +0000 (10:06 -0400)
committerChris Michael <cp.michael@samsung.com>
Tue, 21 Apr 2015 14:06:39 +0000 (10:06 -0400)
Summary:
ecore_imf: init wayland if wayland env var exists

Otherwise ecore-wl functions could return some invalid values. The env var check to avoid error messages.

@fix

Reviewers: Sergeant_Whitespace, devilhorns

Reviewed By: Sergeant_Whitespace

Subscribers: Sergeant_Whitespace, cedric

Differential Revision: https://phab.enlightenment.org/D2253

src/modules/ecore_imf/wayland/wayland_module.c

index cfce52b81afdc1acfdc8bd3ca6cb9797958f48e3..13d09f257b1d9d4b5208f255115576dfe6b9d226 100644 (file)
@@ -143,6 +143,12 @@ im_module_init(void)
    _ecore_imf_wayland_log_dom = 
      eina_log_domain_register("ecore_imf_wayland", EINA_COLOR_YELLOW);
 
+   if (!getenv("WAYLAND_DISPLAY"))
+     return EINA_FALSE;
+
+   if (!ecore_wl_init(NULL))
+     return EINA_FALSE;
+
    ecore_imf_module_register(&wayland_im_info, im_module_create, 
                              im_module_exit);
    EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "im module initalized");
@@ -154,6 +160,7 @@ static void
 im_module_shutdown(void)
 {
    EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "im module shutdown");
+   ecore_wl_shutdown();
 }
 
 EINA_MODULE_INIT(im_module_init);