Fix using global ewd variable by making it part of e_comp_wl

ref T2919

Signed-off-by: Chris Michael <cp.michael@samsung.com>
devs/devilhorns/ecore_wl2
Chris Michael 7 years ago
parent efa015f926
commit c74e7102d3
  1. 11
      src/bin/e_comp_wl.c
  2. 4
      src/bin/e_comp_wl.h
  3. 26
      src/bin/e_grabinput.c
  4. 6
      src/modules/wl_weekeyboard/e_mod_main.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();

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

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

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

Loading…
Cancel
Save