summaryrefslogtreecommitdiff
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
parentefa015f9265dc4d51ced60d804fbaf09799f79ad (diff)
Fix using global ewd variable by making it part of e_comp_wldevs/devilhorns/ecore_wl2
ref 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 @@
9#define COMPOSITOR_VERSION 3 9#define COMPOSITOR_VERSION 3
10 10
11E_API int E_EVENT_WAYLAND_GLOBAL_ADD = -1; 11E_API int E_EVENT_WAYLAND_GLOBAL_ADD = -1;
12E_API Ecore_Wl2_Display *ewd = NULL;
13 12
14#include "session-recovery-server-protocol.h" 13#include "session-recovery-server-protocol.h"
15 14
@@ -2464,15 +2463,15 @@ _e_comp_wl_compositor_create(void)
2464 /* wl_log_set_handler_server(_e_comp_wl_log_cb_print); */ 2463 /* wl_log_set_handler_server(_e_comp_wl_log_cb_print); */
2465 2464
2466 /* try to create an ecore_wl2 display */ 2465 /* try to create an ecore_wl2 display */
2467 ewd = ecore_wl2_display_create(NULL); 2466 cdata->ewd = ecore_wl2_display_create(NULL);
2468 if (!ewd) 2467 if (!cdata->ewd)
2469 { 2468 {
2470 ERR("Could not create a Wayland display: %m"); 2469 ERR("Could not create a Wayland display: %m");
2471 free(cdata); 2470 free(cdata);
2472 return EINA_FALSE; 2471 return EINA_FALSE;
2473 } 2472 }
2474 2473
2475 cdata->wl.disp = ecore_wl2_display_get(ewd); 2474 cdata->wl.disp = ecore_wl2_display_get(cdata->ewd);
2476 if (!cdata->wl.disp) 2475 if (!cdata->wl.disp)
2477 { 2476 {
2478 ERR("Could not create a Wayland display: %m"); 2477 ERR("Could not create a Wayland display: %m");
@@ -2600,7 +2599,7 @@ data_err:
2600comp_global_err: 2599comp_global_err:
2601 /* e_env_unset("WAYLAND_DISPLAY"); */ 2600 /* e_env_unset("WAYLAND_DISPLAY"); */
2602/* sock_err: */ 2601/* sock_err: */
2603 ecore_wl2_display_destroy(ewd); 2602 ecore_wl2_display_destroy(cdata->ewd);
2604disp_err: 2603disp_err:
2605 free(cdata); 2604 free(cdata);
2606 return EINA_FALSE; 2605 return EINA_FALSE;
@@ -2762,7 +2761,7 @@ e_comp_wl_shutdown(void)
2762 if (e_comp_wl->wl.shm) wl_shm_destroy(e_comp_wl->wl.shm); 2761 if (e_comp_wl->wl.shm) wl_shm_destroy(e_comp_wl->wl.shm);
2763 _e_comp_wl_gl_shutdown(); 2762 _e_comp_wl_gl_shutdown();
2764 2763
2765 ecore_wl2_display_destroy(ewd); 2764 ecore_wl2_display_destroy(e_comp_wl->ewd);
2766 2765
2767 /* shutdown ecore_wayland */ 2766 /* shutdown ecore_wayland */
2768 ecore_wl2_shutdown(); 2767 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
98 98
99struct _E_Comp_Wl_Data 99struct _E_Comp_Wl_Data
100{ 100{
101 Ecore_Wl2_Display *ewd;
102
101 struct 103 struct
102 { 104 {
103 struct wl_display *disp; 105 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
341 343
342E_API extern int E_EVENT_WAYLAND_GLOBAL_ADD; 344E_API extern int E_EVENT_WAYLAND_GLOBAL_ADD;
343 345
344E_API extern Ecore_Wl2_Display *ewd;
345
346# ifndef HAVE_WAYLAND_ONLY 346# ifndef HAVE_WAYLAND_ONLY
347EINTERN void e_comp_wl_xwayland_client_queue(E_Client *ec); 347EINTERN void e_comp_wl_xwayland_client_queue(E_Client *ec);
348static inline E_Comp_X_Client_Data * 348static 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)
40 { 40 {
41 Ecore_Wl2_Window *wl_win; 41 Ecore_Wl2_Window *wl_win;
42 42
43 if ((wl_win = ecore_wl2_display_window_find(ewd, grab_mouse_win))) 43 wl_win =
44 ecore_wl2_display_window_find(e_comp_wl->ewd, grab_mouse_win);
45 if (wl_win)
44 ecore_wl2_input_ungrab(ecore_wl2_window_input_get(wl_win), 46 ecore_wl2_input_ungrab(ecore_wl2_window_input_get(wl_win),
45 wl_win, 0); 47 wl_win, 0);
46 } 48 }
@@ -58,7 +60,9 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
58 { 60 {
59 Ecore_Wl2_Window *wl_win; 61 Ecore_Wl2_Window *wl_win;
60 62
61 if ((wl_win = ecore_wl2_display_window_find(ewd, grab_key_win))) 63 wl_win =
64 ecore_wl2_display_window_find(e_comp_wl->ewd, grab_key_win);
65 if (wl_win)
62 ecore_wl2_input_ungrab(ecore_wl2_window_input_get(wl_win), 66 ecore_wl2_input_ungrab(ecore_wl2_window_input_get(wl_win),
63 wl_win, 0); 67 wl_win, 0);
64 } 68 }
@@ -84,7 +88,8 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
84 { 88 {
85 Ecore_Wl2_Window *wl_win; 89 Ecore_Wl2_Window *wl_win;
86 90
87 if ((wl_win = ecore_wl2_display_window_find(ewd, mouse_win))) 91 wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, mouse_win);
92 if (wl_win)
88 ecore_wl2_input_grab(ecore_wl2_window_input_get(wl_win), 93 ecore_wl2_input_grab(ecore_wl2_window_input_get(wl_win),
89 wl_win, 0); 94 wl_win, 0);
90 } 95 }
@@ -114,7 +119,8 @@ e_grabinput_get(Ecore_Window mouse_win, int confine_mouse, Ecore_Window key_win)
114 { 119 {
115 Ecore_Wl2_Window *wl_win; 120 Ecore_Wl2_Window *wl_win;
116 121
117 if ((wl_win = ecore_wl2_display_window_find(key_win))) 122 wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, key_win);
123 if (wl_win)
118 ecore_wl2_input_grab(ecore_wl2_window_input_get(wl_win), 124 ecore_wl2_input_grab(ecore_wl2_window_input_get(wl_win),
119 wl_win, 0); 125 wl_win, 0);
120 } 126 }
@@ -140,7 +146,8 @@ e_grabinput_release(Ecore_Window mouse_win, Ecore_Window key_win)
140 { 146 {
141 Ecore_Wl2_Window *wl_win; 147 Ecore_Wl2_Window *wl_win;
142 148
143 if ((wl_win = ecore_wl2_display_window_find(ewd, mouse_win))) 149 wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, mouse_win);
150 if (wl_win)
144 ecore_wl2_input_ungrab(ecore_wl2_window_input_get(wl_win), 151 ecore_wl2_input_ungrab(ecore_wl2_window_input_get(wl_win),
145 wl_win, 0); 152 wl_win, 0);
146 } 153 }
@@ -158,7 +165,8 @@ e_grabinput_release(Ecore_Window mouse_win, Ecore_Window key_win)
158 { 165 {
159 Ecore_Wl2_Window *wl_win; 166 Ecore_Wl2_Window *wl_win;
160 167
161 if ((wl_win = ecore_wl2_display_window_find(key_win))) 168 wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, key_win);
169 if (wl_win)
162 ecore_wl2_input_grab(ecore_wl2_window_input_get(wl_win), 170 ecore_wl2_input_grab(ecore_wl2_window_input_get(wl_win),
163 wl_win, 0); 171 wl_win, 0);
164 } 172 }
@@ -239,7 +247,7 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method)
239#ifdef HAVE_WAYLAND 247#ifdef HAVE_WAYLAND
240 if (e_comp->comp_type == E_PIXMAP_TYPE_WL) 248 if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
241 { 249 {
242 if ((wl_win = ecore_wl2_display_window_find(ewd, win))) 250 if ((wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, win)))
243 { 251 {
244 /* FIXME: Need to add an ecore_wl_window_focus function */ 252 /* FIXME: Need to add an ecore_wl_window_focus function */
245 } 253 }
@@ -254,7 +262,7 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method)
254#else 262#else
255 if (e_comp->comp_type == E_PIXMAP_TYPE_WL) 263 if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
256 { 264 {
257 if ((wl_win = ecore_wl2_display_window_find(ewd, win))) 265 if ((wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, win)))
258 { 266 {
259 /* FIXME: Need to add an ecore_wl_window_focus function */ 267 /* FIXME: Need to add an ecore_wl_window_focus function */
260 } 268 }
@@ -269,7 +277,7 @@ _e_grabinput_focus_do(Ecore_Window win, E_Focus_Method method)
269#else 277#else
270 if (e_comp->comp_type == E_PIXMAP_TYPE_WL) 278 if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
271 { 279 {
272 if ((wl_win = ecore_wl2_display_window_find(ewd, win))) 280 if ((wl_win = ecore_wl2_display_window_find(e_comp_wl->ewd, win)))
273 { 281 {
274 /* FIXME: Need to add an ecore_wl_window_focus function */ 282 /* FIXME: Need to add an ecore_wl_window_focus function */
275 } 283 }
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)
241 241
242 if (eina_streq(wkb->theme, "default")) 242 if (eina_streq(wkb->theme, "default"))
243 { 243 {
244 ecore_wl2_display_screen_size_get(ewd, &w, &h); 244 ecore_wl2_display_screen_size_get(e_comp_wl->ewd, &w, &h);
245 DBG("Screen size: w=%d, h=%d", w, h); 245 DBG("Screen size: w=%d, h=%d", w, h);
246 if (w >= 1080) 246 if (w >= 1080)
247 w = 1080; 247 w = 1080;
@@ -498,8 +498,8 @@ _wkb_setup(struct weekeyboard *wkb)
498 struct wl_input_panel_surface *ips; 498 struct wl_input_panel_surface *ips;
499 void *data; 499 void *data;
500 500
501 registry = e_comp_wl->wl.registry ?: ecore_wl2_display_registry_get(ewd); 501 registry = e_comp_wl->wl.registry ?: ecore_wl2_display_registry_get(e_comp_wl->ewd);
502 itr = ecore_wl2_display_globals_get(ewd); 502 itr = ecore_wl2_display_globals_get(e_comp_wl->ewd);
503 EINA_ITERATOR_FOREACH(itr, data) 503 EINA_ITERATOR_FOREACH(itr, data)
504 { 504 {
505 global = (Ecore_Wl2_Global *)data; 505 global = (Ecore_Wl2_Global *)data;