summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman.samsung@gmail.com>2018-08-08 09:37:29 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-08-08 09:37:30 -0400
commite382bac1a01a152d32a0f95df7a2ad6b84ae80d4 (patch)
tree337a9d04375fc4bb6680cf0172b644a2dffc967e
parenta7f65c75d9073e624e129f4bc423d7854838c2c0 (diff)
wayland: Fix elementary setting window parents at creation time
Summary: We need to pass the entire pointer, not just 32-bits of it. Fixes a crash with enlightenment sandbox gadgets where ecore_wl2_window_alpha_get() is called with an invalid pointer while trying to display a pop-up. Reviewers: zmike, devilhorns Reviewed By: zmike, devilhorns Subscribers: devilhorns, cedric, #reviewers, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6775
-rw-r--r--src/lib/ecore_evas/ecore_evas.c53
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h8
-rw-r--r--src/lib/elementary/efl_ui_win.c7
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c2
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c2
5 files changed, 64 insertions, 8 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 004896de90..cce53df4e9 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -4,6 +4,7 @@
4 4
5#define ECORE_EVAS_INTERNAL 5#define ECORE_EVAS_INTERNAL
6#define EFL_INPUT_EVENT_PROTECTED 6#define EFL_INPUT_EVENT_PROTECTED
7#define IPA_YLNO_ESU_LANRETNI_MLE
7 8
8#include <stdlib.h> 9#include <stdlib.h>
9#include <string.h> 10#include <string.h>
@@ -4339,14 +4340,16 @@ ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent,
4339 int x, int y, int w, int h, Eina_Bool frame) 4340 int x, int y, int w, int h, Eina_Bool frame)
4340{ 4341{
4341 Ecore_Evas *ee; 4342 Ecore_Evas *ee;
4342 Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int, Eina_Bool); 4343 Ecore_Evas *(*new)(const char *, Ecore_Window, int, int, int, int, Eina_Bool);
4343 Eina_Module *m = _ecore_evas_engine_load("wayland"); 4344 Eina_Module *m = _ecore_evas_engine_load("wayland");
4344 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 4345 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
4345 4346
4346 new = eina_module_symbol_get(m, "ecore_evas_wayland_shm_new_internal"); 4347 new = eina_module_symbol_get(m, "ecore_evas_wayland_shm_new_internal");
4347 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL); 4348 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
4348 4349
4349 ee = new(disp_name, parent, x, y, w, h, frame); 4350 if (parent) ERR("Wayland windows with parents not supported through legacy API");
4351
4352 ee = new(disp_name, 0, x, y, w, h, frame);
4350 if (!_ecore_evas_cursors_init(ee)) 4353 if (!_ecore_evas_cursors_init(ee))
4351 { 4354 {
4352 ecore_evas_free(ee); 4355 ecore_evas_free(ee);
@@ -4360,7 +4363,51 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent,
4360 int x, int y, int w, int h, Eina_Bool frame) 4363 int x, int y, int w, int h, Eina_Bool frame)
4361{ 4364{
4362 Ecore_Evas *ee; 4365 Ecore_Evas *ee;
4363 Ecore_Evas *(*new)(const char *, unsigned int, int, int, int, int, Eina_Bool); 4366 Ecore_Evas *(*new)(const char *, Ecore_Window, int, int, int, int, Eina_Bool);
4367 Eina_Module *m = _ecore_evas_engine_load("wayland");
4368 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
4369
4370 new = eina_module_symbol_get(m, "ecore_evas_wayland_egl_new_internal");
4371 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
4372
4373 if (parent) ERR("Wayland windows with parents not supported through legacy API");
4374
4375 ee = new(disp_name, 0, x, y, w, h, frame);
4376 if (!_ecore_evas_cursors_init(ee))
4377 {
4378 ecore_evas_free(ee);
4379 return NULL;
4380 }
4381 return ee;
4382}
4383
4384Ecore_Evas *
4385_wayland_shm_new(const char *disp_name, Ecore_Window parent,
4386 int x, int y, int w, int h, Eina_Bool frame)
4387{
4388 Ecore_Evas *ee;
4389 Ecore_Evas *(*new)(const char *, Ecore_Window, int, int, int, int, Eina_Bool);
4390 Eina_Module *m = _ecore_evas_engine_load("wayland");
4391 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
4392
4393 new = eina_module_symbol_get(m, "ecore_evas_wayland_shm_new_internal");
4394 EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
4395
4396 ee = new(disp_name, parent, x, y, w, h, frame);
4397 if (!_ecore_evas_cursors_init(ee))
4398 {
4399 ecore_evas_free(ee);
4400 return NULL;
4401 }
4402 return ee;
4403}
4404
4405Ecore_Evas *
4406_wayland_egl_new(const char *disp_name, Ecore_Window parent,
4407 int x, int y, int w, int h, Eina_Bool frame)
4408{
4409 Ecore_Evas *ee;
4410 Ecore_Evas *(*new)(const char *, Ecore_Window, int, int, int, int, Eina_Bool);
4364 Eina_Module *m = _ecore_evas_engine_load("wayland"); 4411 Eina_Module *m = _ecore_evas_engine_load("wayland");
4365 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL); 4412 EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
4366 4413
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index c419699296..c9f158ee9b 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -490,6 +490,14 @@ EAPI Eina_Bool ecore_evas_render(Ecore_Evas *ee);
490EAPI Evas *ecore_evas_evas_new(Ecore_Evas *ee, int w, int h); 490EAPI Evas *ecore_evas_evas_new(Ecore_Evas *ee, int w, int h);
491EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window); 491EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window);
492 492
493#ifdef IPA_YLNO_ESU_LANRETNI_MLE
494EAPI Ecore_Evas *_wayland_shm_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame);
495EAPI Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame);
496#else
497#define _wayland_shm_new DONT_USE_INTERNAL_API
498#define _wayland_egl_new DONT_USE_INTERNAL_API
499#endif
500
493static inline Eina_Bool 501static inline Eina_Bool
494ecore_evas_render_prepare(Ecore_Evas *ee) 502ecore_evas_render_prepare(Ecore_Evas *ee)
495{ 503{
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index ebab8fecd0..9a2a9ab1ba 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -16,6 +16,7 @@
16#define EFL_CANVAS_SCENE_BETA 16#define EFL_CANVAS_SCENE_BETA
17#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED 17#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED
18#define EFL_PART_PROTECTED 18#define EFL_PART_PROTECTED
19#define IPA_YLNO_ESU_LANRETNI_MLE
19 20
20#include <Elementary.h> 21#include <Elementary.h>
21#include <Elementary_Cursor.h> 22#include <Elementary_Cursor.h>
@@ -4953,7 +4954,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
4953 Eina_Stringshare *accel = NULL; 4954 Eina_Stringshare *accel = NULL;
4954 Eina_Bool is_gl_accel; 4955 Eina_Bool is_gl_accel;
4955 int i, p = 0; 4956 int i, p = 0;
4956 int parent_id = 0; 4957 Ecore_Window parent_id = 0;
4957 4958
4958 Efl_Ui_Win_Data tmp_sd; 4959 Efl_Ui_Win_Data tmp_sd;
4959 4960
@@ -5254,9 +5255,9 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
5254 tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 0, 0); 5255 tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 0, 0);
5255 } 5256 }
5256 else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM)) 5257 else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM))
5257 tmp_sd.ee = ecore_evas_wayland_shm_new(NULL, parent_id, 0, 0, 0, 0, 0); 5258 tmp_sd.ee = _wayland_shm_new(NULL, parent_id, 0, 0, 0, 0, 0);
5258 else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL)) 5259 else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL))
5259 tmp_sd.ee = ecore_evas_wayland_egl_new(NULL, parent_id, 0, 0, 0, 0, 0); 5260 tmp_sd.ee = _wayland_egl_new(NULL, parent_id, 0, 0, 0, 0, 0);
5260 else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32)) 5261 else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32))
5261 tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1); 5262 tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
5262 else if (!strcmp(enginelist[i], ELM_SOFTWARE_DDRAW)) 5263 else if (!strcmp(enginelist[i], ELM_SOFTWARE_DDRAW))
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
index 0ecd868975..8cfd1b180b 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
@@ -29,7 +29,7 @@
29 29
30/* external functions */ 30/* external functions */
31EAPI Ecore_Evas * 31EAPI Ecore_Evas *
32ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame) 32ecore_evas_wayland_egl_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame)
33{ 33{
34 LOGFN(__FILE__, __LINE__, __FUNCTION__); 34 LOGFN(__FILE__, __LINE__, __FUNCTION__);
35 35
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
index b01d02bf18..c722a07ab6 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
@@ -29,7 +29,7 @@
29 29
30/* external functions */ 30/* external functions */
31EAPI Ecore_Evas * 31EAPI Ecore_Evas *
32ecore_evas_wayland_shm_new_internal(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame) 32ecore_evas_wayland_shm_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame)
33{ 33{
34 LOGFN(__FILE__, __LINE__, __FUNCTION__); 34 LOGFN(__FILE__, __LINE__, __FUNCTION__);
35 35