aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-12-07 09:46:11 -0500
committerChris Michael <cp.michael@samsung.com>2015-12-07 09:46:11 -0500
commitc74e7102d34b8905f92b882d2b9439426b45e7ec (patch)
tree0907d1ee04f31a105b3a139331de4a6788f4d6be
parentTry to init (and error check the init) of ecore_wl2 library before we (diff)
downloadenlightenment-devs/devilhorns/ecore_wl2.tar.gz
Fix using global ewd variable by making it part of e_comp_wldevs/devilhorns/ecore_wl2
ref https://phab.enlightenment.org/T2919 Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/bin/e_comp_wl.c11
-rw-r--r--src/bin/e_comp_wl.h4
-rw-r--r--src/bin/e_grabinput.c26
-rw-r--r--src/modules/wl_weekeyboard/e_mod_main.c6
4 files changed, 27 insertions, 20 deletions
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index b2ff731cc..a5d34392c 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -9,7 +9,6 @@
#define COMPOSITOR_VERSION 3
E_API int E_EVENT_WAYLAND_GLOBAL_ADD = -1;
-E_API Ecore_Wl2_Display *ewd = NULL;
#include "session-recovery-server-protocol.h"
@@ -2464,15 +2463,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");
@@ -2600,7 +2599,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;
@@ -2762,7 +2761,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 e60ae9e44..814d06177 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -98,6 +98,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 fdc864716..ff764f14c 100644
--- a/src/bin/e_grabinput.c
+++ b/src/bin/e_grabinput.c
@@ -40,7 +40,9 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
{
Ecore_Wl2_Window *wl_win;
- if ((wl_win = ecore_wl2_display_window_find(ewd, grab_mouse_win)))
+ wl_win =
+ ecore_wl2_display_window_find(e_comp_wl->ewd, grab_mouse_win);
+ if (wl_win)
ecore_wl2_input_ungrab(ecore_wl2_window_input_get(wl_win),
wl_win, 0);
}
@@ -58,7 +60,9 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
{
Ecore_Wl2_Window *wl_win;
- if ((wl_win = ecore_wl2_display_window_find(ewd, grab_key_win)))
+ wl_win =
+ ecore_wl2_display_window_find(e_comp_wl->ewd, grab_key_win);
+ if (wl_win)
ecore_wl2_input_ungrab(ecore_wl2_window_input_get(wl_win),
wl_win, 0);
}
@@ -84,7 +88,8 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
{
Ecore_Wl2_Window *wl_win;
- if ((wl_win = ecore_wl2_display_window_find(ewd, mouse_win)))
+ wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, mouse_win);
+ if (wl_win)
ecore_wl2_input_grab(ecore_wl2_window_input_get(wl_win),
wl_win, 0);
}
@@ -114,7 +119,8 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
{
Ecore_Wl2_Window *wl_win;
- if ((wl_win = ecore_wl2_display_window_find(key_win)))
+ wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, key_win);
+ if (wl_win)
ecore_wl2_input_grab(ecore_wl2_window_input_get(wl_win),
wl_win, 0);
}
@@ -140,7 +146,8 @@ e_grabinput_release(Ecore_Window mouse_win, Ecore_Window key_win)
{
Ecore_Wl2_Window *wl_win;
- if ((wl_win = ecore_wl2_display_window_find(ewd, mouse_win)))
+ wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, mouse_win);
+ if (wl_win)
ecore_wl2_input_ungrab(ecore_wl2_window_input_get(wl_win),
wl_win, 0);
}
@@ -158,7 +165,8 @@ e_grabinput_release(Ecore_Window mouse_win, Ecore_Window key_win)
{
Ecore_Wl2_Window *wl_win;
- if ((wl_win = ecore_wl2_display_window_find(key_win)))
+ wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, key_win);
+ if (wl_win)
ecore_wl2_input_grab(ecore_wl2_window_input_get(wl_win),
wl_win, 0);
}
@@ -239,7 +247,7 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method)
#ifdef HAVE_WAYLAND
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
{
- if ((wl_win = ecore_wl2_display_window_find(ewd, win)))
+ if ((wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, win)))
{
/* FIXME: Need to add an ecore_wl_window_focus function */
}
@@ -254,7 +262,7 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method)
#else
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
{
- if ((wl_win = ecore_wl2_display_window_find(ewd, win)))
+ if ((wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, win)))
{
/* FIXME: Need to add an ecore_wl_window_focus function */
}
@@ -269,7 +277,7 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method)
#else
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
{
- if ((wl_win = ecore_wl2_display_window_find(ewd, win)))
+ if ((wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, win)))
{
/* FIXME: Need to add an ecore_wl_window_focus function */
}
diff --git a/src/modules/wl_weekeyboard/e_mod_main.c b/src/modules/wl_weekeyboard/e_mod_main.c
index 7df6ff7d0..3efc1f14b 100644
--- a/src/modules/wl_weekeyboard/e_mod_main.c
+++ b/src/modules/wl_weekeyboard/e_mod_main.c
@@ -241,7 +241,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;
@@ -498,8 +498,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;