summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2019-11-19 09:37:11 -0500
committerChristopher Michael <cp.michael@samsung.com>2019-11-19 09:44:45 -0500
commite36b1930bf04694fb67dd7e741dbcb5231bf5e58 (patch)
treee23a0328fe455ca39ecf6c3552461b0ae2c3dc13 /src
parent8195368929be462427e430455e66b9d7dc952622 (diff)
ecore-wl2: Add API to find a window by given surface
This patch adds a convenience function to find a window by a given wl_surface. @feature
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h10
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c15
2 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 04dd80a..6f8f9dc 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -1361,6 +1361,16 @@ EAPI void ecore_wl2_window_floating_mode_set(Ecore_Wl2_Window *window, Eina_Bool
1361EAPI Eina_Bool ecore_wl2_window_floating_mode_get(Ecore_Wl2_Window *window); 1361EAPI Eina_Bool ecore_wl2_window_floating_mode_get(Ecore_Wl2_Window *window);
1362 1362
1363/** 1363/**
1364 * Finds a window by surface
1365 *
1366 * @param surface The surface to find the window of
1367 *
1368 * @ingroup Ecore_Wl2_Window_Group
1369 * @since 1.24
1370 */
1371EAPI Ecore_Wl2_Window *ecore_wl2_window_surface_find(struct wl_surface *surface);
1372
1373/**
1364 * @defgroup Ecore_Wl2_Input_Group Wayland Library Input Functions 1374 * @defgroup Ecore_Wl2_Input_Group Wayland Library Input Functions
1365 * @ingroup Ecore_Wl2_Group 1375 * @ingroup Ecore_Wl2_Group
1366 * 1376 *
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 6ba894b..d31dcaf 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -1748,3 +1748,18 @@ ecore_wl2_window_type_get(Ecore_Wl2_Window *window)
1748 EINA_SAFETY_ON_NULL_RETURN_VAL(window, ECORE_WL2_WINDOW_TYPE_NONE); 1748 EINA_SAFETY_ON_NULL_RETURN_VAL(window, ECORE_WL2_WINDOW_TYPE_NONE);
1749 return window->type; 1749 return window->type;
1750} 1750}
1751
1752EAPI Ecore_Wl2_Window *
1753ecore_wl2_window_surface_find(struct wl_surface *surface)
1754{
1755 Ecore_Wl2_Display *ewd;
1756 Ecore_Wl2_Window *win;
1757
1758 EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
1759
1760 ewd = ecore_wl2_connected_display_get(NULL);
1761 EINA_SAFETY_ON_NULL_RETURN_VAL(ewd, NULL);
1762
1763 win = ecore_wl2_display_window_find_by_surface(ewd, surface);
1764 return win;
1765}