diff options
author | Derek Foreman <derek.foreman.samsung@gmail.com> | 2018-08-08 09:37:29 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2018-08-08 09:37:30 -0400 |
commit | e382bac1a01a152d32a0f95df7a2ad6b84ae80d4 (patch) | |
tree | 337a9d04375fc4bb6680cf0172b644a2dffc967e /src/lib/ecore_evas | |
parent | a7f65c75d9073e624e129f4bc423d7854838c2c0 (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
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r-- | src/lib/ecore_evas/ecore_evas.c | 53 | ||||
-rw-r--r-- | src/lib/ecore_evas/ecore_evas_private.h | 8 |
2 files changed, 58 insertions, 3 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 | |||
4384 | Ecore_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 | |||
4405 | Ecore_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); | |||
490 | EAPI Evas *ecore_evas_evas_new(Ecore_Evas *ee, int w, int h); | 490 | EAPI Evas *ecore_evas_evas_new(Ecore_Evas *ee, int w, int h); |
491 | EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window); | 491 | EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window); |
492 | 492 | ||
493 | #ifdef IPA_YLNO_ESU_LANRETNI_MLE | ||
494 | EAPI Ecore_Evas *_wayland_shm_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame); | ||
495 | EAPI 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 | |||
493 | static inline Eina_Bool | 501 | static inline Eina_Bool |
494 | ecore_evas_render_prepare(Ecore_Evas *ee) | 502 | ecore_evas_render_prepare(Ecore_Evas *ee) |
495 | { | 503 | { |