This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch devs/devilhorns/apos
in repository efl.

View the commit online.

commit 4dc293969305ea97b69ac36f67231a78a089381e
Author: Christopher Michael <devilho...@comcast.net>
AuthorDate: Thu Sep 4 08:00:13 2025 -0500

    ecore_drm2: Add API function to return a list of displays inside given
    dimensions
---
 src/lib/ecore_drm2/Ecore_Drm2.h          |  1 +
 src/lib/ecore_drm2/ecore_drm2_displays.c | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index d1ba90bbb6..2dcc87dae8 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -165,6 +165,7 @@ EAPI void ecore_drm2_display_relative_mode_set(Ecore_Drm2_Display *disp, Ecore_D
 EAPI void ecore_drm2_display_relative_to_set(Ecore_Drm2_Display *disp, const char *relative);
 EAPI void ecore_drm2_display_dpi_get(Ecore_Drm2_Display *disp, int *xdpi, int *ydpi);
 EAPI Ecore_Drm2_Display *ecore_drm2_display_find(Ecore_Drm2_Device *dev, int x, int y);
+EAPI Eina_List *ecore_drm2_displays_find(Ecore_Drm2_Device *dev, int x, int  y, int w, int h);
 EAPI void ecore_drm2_display_user_data_set(Ecore_Drm2_Display *disp, void *data);
 EAPI void *ecore_drm2_display_user_data_get(Ecore_Drm2_Display *disp);
 EAPI Eina_Bool ecore_drm2_display_blanktime_get(Ecore_Drm2_Display *disp, int seq, long *sec, long *usec);
diff --git a/src/lib/ecore_drm2/ecore_drm2_displays.c b/src/lib/ecore_drm2/ecore_drm2_displays.c
index 30b8c665c7..14c4cdb39f 100644
--- a/src/lib/ecore_drm2/ecore_drm2_displays.c
+++ b/src/lib/ecore_drm2/ecore_drm2_displays.c
@@ -3,6 +3,9 @@
 #define INSIDE(x, y, xx, yy, ww, hh) \
    (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && \
        ((x) >= (xx)) && ((y) >= (yy)))
+#define CONTAINS(x, y, w, h, xx, yy, ww, hh) \
+     (((xx) >= (x)) && (((x) + (w)) >= ((xx) + (ww))) && ((yy) >= (y)) && \
+         (((y) + (h)) >= ((yy) + (hh))))
 
 #define EDID_DESCRIPTOR_ALPHANUMERIC_DATA_STRING 0xfe
 #define EDID_DESCRIPTOR_DISPLAY_PRODUCT_NAME 0xfc
@@ -1371,6 +1374,29 @@ ecore_drm2_display_find(Ecore_Drm2_Device *dev, int x, int y)
    return NULL;
 }
 
+EAPI Eina_List *
+ecore_drm2_displays_find(Ecore_Drm2_Device *dev, int x, int  y, int w, int h)
+{
+   Eina_List *ret = NULL, *l;
+   Ecore_Drm2_Display *disp;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL);
+
+   EINA_LIST_FOREACH(dev->displays, l, disp)
+     {
+        int ox, oy, ow, oh;
+
+	if (!disp->crtc) continue;
+        if (!disp->crtc->state.current->active.value) continue;
+
+        ecore_drm2_display_info_get(disp, &ox, &oy, &ow, &oh, NULL);
+        if (CONTAINS(x, y, w, h, ox, oy, ow, oh))
+          ret = eina_list_append(ret, disp);
+     }
+
+   return ret;
+}
+
 EAPI void
 ecore_drm2_display_user_data_set(Ecore_Drm2_Display *disp, void *data)
 {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to