devilhorns pushed a commit to branch master.

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

commit a10a9ceccb9af0856ed653d1d821e36307b85872
Author: Christopher Michael <[email protected]>
Date:   Tue Nov 19 09:01:53 2019 -0500

    ecore-wl2: Add API to find a window by surface
    
    This patch adds a convenience API that can be used to find a window
    based on wl_surface.
    
    @feature
---
 src/lib/ecore_wl2/Ecore_Wl2.h         | 13 +++++++++++++
 src/lib/ecore_wl2/ecore_wl2_display.c |  6 ++++++
 2 files changed, 19 insertions(+)

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index eca4733710..38c81055f1 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -713,6 +713,19 @@ EAPI Eina_Bool ecore_wl2_display_sync_is_done(const 
Ecore_Wl2_Display *display);
  */
 EAPI const char *ecore_wl2_display_name_get(const Ecore_Wl2_Display *display);
 
+/**
+ * Finds an Ecore_Wl2_Window based on wl_surface
+ *
+ * @param display The display to search for the window
+ * @param surface The wl_surface of the window to find
+ *
+ * @return The Ecore_Wl2_Window if found, or NULL if no such window exists
+ *
+ * @ingroup Ecore_Wl2_Display_Group
+ * @since 1.24
+ */
+EAPI Ecore_Wl2_Window 
*ecore_wl2_display_window_find_by_surface(Ecore_Wl2_Display *display, struct 
wl_surface *surface);
+
 /**
  * @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 a1511c4711..85873fac69 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -1163,3 +1163,9 @@ ecore_wl2_display_flush(Ecore_Wl2_Display *display)
 
    _begin_recovery_maybe(display, code);
 }
+
+EAPI Ecore_Wl2_Window *
+ecore_wl2_display_window_find_by_surface(Ecore_Wl2_Display *display, struct 
wl_surface *surface)
+{
+   return _ecore_wl2_display_window_surface_find(display, surface);
+}

-- 


Reply via email to