ecore_wl2: get window from subsurface 54/253554/1 accepted/tizen/unified/20210216.015108 submit/tizen/20210215.095045
authorShinwoo Kim <cinoo.kim@samsung.com>
Mon, 15 Feb 2021 09:35:21 +0000 (18:35 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Mon, 15 Feb 2021 09:35:21 +0000 (18:35 +0900)
There is a requirement to get ecore_wl2_window from
given ecore_wl2_subsurface.

Change-Id: Idffef92b50b4edc474ae53cb7df5ffc65b26f615

src/lib/ecore_wl2/Ecore_Wl2.h
src/lib/ecore_wl2/ecore_wl2_subsurf.c

index 634a3e3..4eb8635 100644 (file)
@@ -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,
index 4df56a3..070a2ce 100644 (file)
@@ -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)
 {