devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ab51bbeeef36eb951d2b0327a0d2f9513847f3ca

commit ab51bbeeef36eb951d2b0327a0d2f9513847f3ca
Author: Christopher Michael <[email protected]>
Date:   Tue Nov 19 09:23:18 2019 -0500

    ecore-wl2: Add API to return the compositor object from a given display
    
    This patch adds a convenience function to get the wl_compositor object
    from a given display
    
    @feature
---
 src/lib/ecore_wl2/Ecore_Wl2.h         | 12 ++++++++++++
 src/lib/ecore_wl2/ecore_wl2_display.c |  7 +++++++
 2 files changed, 19 insertions(+)

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index ffb32e390d..b06f3b1375 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -742,6 +742,18 @@ EAPI Ecore_Wl2_Window 
*ecore_wl2_display_window_find_by_surface(Ecore_Wl2_Displa
  */
 EAPI Ecore_Wl2_Display *ecore_wl2_connected_display_get(const char *name);
 
+/**
+ * Gets the wl_compositor which belongs to this display
+ *
+ * @param display The Ecore_Wl2_Display to get the compositor of
+ *
+ * @return The wl_compositor associated with this display
+ *
+ * @ingroup Ecore_Wl2_Display_Group
+ * @since 1.24
+ */
+EAPI struct wl_compositor *ecore_wl2_display_compositor_get(Ecore_Wl2_Display 
*display);
+
 /**
  * @defgroup Ecore_Wl2_Window_Group Wayland Library Window Functions
  * @ingroup Ecore_Wl2_Group
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c 
b/src/lib/ecore_wl2/ecore_wl2_display.c
index 267e62511d..cc92b8f871 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -1200,3 +1200,10 @@ ecore_wl2_connected_display_get(const char *name)
 
    return ewd;
 }
+
+EAPI struct wl_compositor *
+ecore_wl2_display_compositor_get(Ecore_Wl2_Display *display)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
+   return display->wl.compositor;
+}

-- 


Reply via email to