From: Shinwoo Kim Date: Mon, 15 Feb 2021 09:35:21 +0000 (+0900) Subject: ecore_wl2: get window from subsurface X-Git-Tag: accepted/tizen/unified/20210216.015108^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44d9de49c2de4b9f6f16fe3ac953251d040b2440;p=platform%2Fupstream%2Fefl.git ecore_wl2: get window from subsurface There is a requirement to get ecore_wl2_window from given ecore_wl2_subsurface. Change-Id: Idffef92b50b4edc474ae53cb7df5ffc65b26f615 --- diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 634a3e3..4eb8635 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -3152,6 +3152,17 @@ EAPI void ecore_wl2_subsurface_sync_set(Ecore_Wl2_Subsurface *subsurface, Eina_B EAPI void *ecore_wl2_subsurface_native_surface_get(Ecore_Wl2_Subsurface *subsurface); /** + * @brief Get parent window for this subsurface + * + * @param subsurface the subsurface + * + * @return the Ecore_Wl2_Window associated with this subsurface, or NULL on failure. + * + * @ingroup Ecore_Wl2_Subsurface_Group + */ +EAPI Ecore_Wl2_Window *ecore_wl2_subsurface_window_get(Ecore_Wl2_Subsurface *subsurface); + +/** * @brief Place subsurface on layer above a reference subsurface * * Moves the subsurface to just above the reference subsurface, diff --git a/src/lib/ecore_wl2/ecore_wl2_subsurf.c b/src/lib/ecore_wl2/ecore_wl2_subsurf.c index 4df56a3..070a2ce 100644 --- a/src/lib/ecore_wl2/ecore_wl2_subsurf.c +++ b/src/lib/ecore_wl2/ecore_wl2_subsurf.c @@ -297,6 +297,13 @@ ecore_wl2_subsurface_native_surface_get(Ecore_Wl2_Subsurface *subsurface) return subsurface->wl.surface; } +EAPI Ecore_Wl2_Window * +ecore_wl2_subsurface_window_get(Ecore_Wl2_Subsurface *subsurface) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(subsurface, NULL); + return subsurface->parent; +} + EAPI Eina_Bool ecore_wl2_subsurface_video_surface_destination_set(Ecore_Wl2_Subsurface *subsurface, int x, int y, int w, int h) {