discomfitor pushed a commit to branch enlightenment-0.20.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=96b55ce441d68c7a23a15a344c850d92a35af544

commit 96b55ce441d68c7a23a15a344c850d92a35af544
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Mon Dec 7 09:46:11 2015 -0500

    Fix using global ewd variable by making it part of e_comp_wl
    
    ref T2919
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/bin/e_comp_wl.c                     | 11 +++++------
 src/bin/e_comp_wl.h                     |  4 ++--
 src/bin/e_grabinput.c                   |  1 -
 src/modules/wl_weekeyboard/e_mod_main.c |  6 +++---
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 4fee9dc..52504de 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -14,7 +14,6 @@
 #endif
 
 E_API int E_EVENT_WAYLAND_GLOBAL_ADD = -1;
-E_API Ecore_Wl2_Display *ewd = NULL;
 
 #include "session-recovery-server-protocol.h"
 
@@ -2542,15 +2541,15 @@ _e_comp_wl_compositor_create(void)
    /* wl_log_set_handler_server(_e_comp_wl_log_cb_print); */
 
    /* try to create an ecore_wl2 display */
-   ewd = ecore_wl2_display_create(NULL);
-   if (!ewd)
+   cdata->ewd = ecore_wl2_display_create(NULL);
+   if (!cdata->ewd)
      {
         ERR("Could not create a Wayland display: %m");
         free(cdata);
         return EINA_FALSE;
      }
 
-   cdata->wl.disp = ecore_wl2_display_get(ewd);
+   cdata->wl.disp = ecore_wl2_display_get(cdata->ewd);
    if (!cdata->wl.disp)
      {
         ERR("Could not create a Wayland display: %m");
@@ -2677,7 +2676,7 @@ data_err:
 comp_global_err:
    /* e_env_unset("WAYLAND_DISPLAY"); */
 /* sock_err: */
-   ecore_wl2_display_destroy(ewd);
+   ecore_wl2_display_destroy(cdata->ewd);
 disp_err:
    free(cdata);
    return EINA_FALSE;
@@ -2839,7 +2838,7 @@ e_comp_wl_shutdown(void)
    if (e_comp_wl->wl.shm) wl_shm_destroy(e_comp_wl->wl.shm);
    _e_comp_wl_gl_shutdown();
 
-   ecore_wl2_display_destroy(ewd);
+   ecore_wl2_display_destroy(e_comp_wl->ewd);
 
    /* shutdown ecore_wayland */
    ecore_wl2_shutdown();
diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h
index 1493d14..41dcdae 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -99,6 +99,8 @@ struct _E_Comp_Wl_Subsurf_Data
 
 struct _E_Comp_Wl_Data
 {
+   Ecore_Wl2_Display *ewd;
+
    struct
      {
         struct wl_display *disp;
@@ -341,8 +343,6 @@ E_API Eina_Bool e_comp_wl_evas_handle_mouse_button(E_Client 
*ec, uint32_t timest
 
 E_API extern int E_EVENT_WAYLAND_GLOBAL_ADD;
 
-E_API extern Ecore_Wl2_Display *ewd;
-
 # ifndef HAVE_WAYLAND_ONLY
 EINTERN void e_comp_wl_xwayland_client_queue(E_Client *ec);
 static inline E_Comp_X_Client_Data *
diff --git a/src/bin/e_grabinput.c b/src/bin/e_grabinput.c
index c050a08..6bf5852 100644
--- a/src/bin/e_grabinput.c
+++ b/src/bin/e_grabinput.c
@@ -189,7 +189,6 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method 
method)
       case E_FOCUS_METHOD_PASSIVE:
 #ifndef HAVE_WAYLAND_ONLY
         if (e_comp_util_has_x())
-          ecore_x_window_focus(win);
 #endif
         break;
 
diff --git a/src/modules/wl_weekeyboard/e_mod_main.c 
b/src/modules/wl_weekeyboard/e_mod_main.c
index 060a5a7..5a45aea 100644
--- a/src/modules/wl_weekeyboard/e_mod_main.c
+++ b/src/modules/wl_weekeyboard/e_mod_main.c
@@ -250,7 +250,7 @@ _wkb_ui_setup(struct weekeyboard *wkb)
 
    if (eina_streq(wkb->theme, "default"))
      {
-        ecore_wl2_display_screen_size_get(ewd, &w, &h);
+        ecore_wl2_display_screen_size_get(e_comp_wl->ewd, &w, &h);
         DBG("Screen size: w=%d, h=%d", w, h);
         if (w >= 1080)
           w = 1080;
@@ -507,8 +507,8 @@ _wkb_setup(struct weekeyboard *wkb)
    struct wl_input_panel_surface *ips;
    void *data;
 
-   registry = e_comp_wl->wl.registry ?: ecore_wl2_display_registry_get(ewd);
-   itr = ecore_wl2_display_globals_get(ewd);
+   registry = e_comp_wl->wl.registry ?: 
ecore_wl2_display_registry_get(e_comp_wl->ewd);
+   itr = ecore_wl2_display_globals_get(e_comp_wl->ewd);
    EINA_ITERATOR_FOREACH(itr, data)
      {
         global = (Ecore_Wl2_Global *)data;

-- 


Reply via email to