Fix using global ewd variable by making it part of e_comp_wl

ref T2919

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-12-07 09:46:11 -05:00 committed by Mike Blumenkrantz
parent be2221ed95
commit 96b55ce441
4 changed files with 10 additions and 12 deletions

View File

@ -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();

View File

@ -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 *

View File

@ -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;

View File

@ -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;