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
This commit is contained in:
Mike Blumenkrantz 2020-03-12 12:15:43 -04:00
parent 453a0fb82a
commit b51d45835c
3 changed files with 11 additions and 15 deletions

View File

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

View File

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

View File

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