zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b51d45835c534970361845e4f666d405d5b66d6a
commit b51d45835c534970361845e4f666d405d5b66d6a Author: Mike Blumenkrantz <[email protected]> Date: Thu Mar 12 12:15:43 2020 -0400 efl-wl: rework parent surface getter to a more useful property Summary: getting any parent is probably fine Depends on D11466 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11467 --- src/lib/efl_wl/Efl_Wl.h | 4 ++-- src/lib/efl_wl/efl_wl.c | 16 +++------------- src/lib/efl_wl/efl_wl_surface.eo | 6 ++++++ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h index 06fca3f5b5..5676d892ae 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_wl/Efl_Wl.h @@ -199,7 +199,7 @@ EAPI int32_t efl_wl_surface_pid_get(Evas_Object *surface); * @since 1.21 */ EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource); - +#if 0 /** * Get the Evas_Object for an extracted surface's parent, or NULL if the parent is not extracted * @@ -210,7 +210,7 @@ EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource); * @since 1.21 */ EAPI Evas_Object *efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface); - +#endif /** * Set external xkbcommon resources to be used read-only by the compositor object * diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index d6b77f4f44..c56ec323f7 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -5773,22 +5773,12 @@ efl_wl_extracted_surface_object_find(void *surface_resource) return cs->obj; } -Eo * -efl_wl_extracted_surface_extracted_parent_get(Eo *surface) +static EOLIAN Eo * +_efl_wl_surface_parent_surface_get(const Eo *surface, Comp_Surface *cs) { - Comp_Surface *cs; - - EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL); - cs = efl_data_scope_get(surface, EFL_WL_SURFACE_CLASS); - if (!cs) abort(); - EINA_SAFETY_ON_TRUE_RETURN_VAL(!cs->extracted, NULL); EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, NULL); - if (cs->parent) - { - if (!cs->parent->extracted) return NULL; - return cs->parent->obj; - } + if (cs->parent && cs->role) return cs->parent->obj; return NULL; } diff --git a/src/lib/efl_wl/efl_wl_surface.eo b/src/lib/efl_wl/efl_wl_surface.eo index 8f8e44c893..65c7327c95 100644 --- a/src/lib/efl_wl/efl_wl_surface.eo +++ b/src/lib/efl_wl/efl_wl_surface.eo @@ -12,6 +12,12 @@ class @beta Efl.Wl.Surface extends Efl.Canvas.Group pid: int; } } + @property parent_surface { + get {} + values { + parent: Efl.Wl.Surface; + } + } } implements { Efl.Object.constructor; --
