Summary: This adds a function (ecore_drm_device_pointer_xy_get) to we
can return the mouse position inside ecore_evas_pointer_xy_get calls.
This is going to be used for centering the mouse when E-Wl starts up.
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
*/
EAPI Eina_Stringshare *ecore_drm_output_make_get(Ecore_Drm_Output *output);
+/**
+ * Get the pointer position of Ecore_Drm_Device
+ *
+ * This function will give the pointer position of Ecore_Drm_Device
+ *
+ * @param dev The Ecore_Drm_Device to get pointer position for
+ * @param *x The parameter in which output x co-ordinate is stored
+ * @param *y The parameter in which output y co-ordinate is stored
+ *
+ * @ingroup Ecore_Drm_Device_Group
+ * @since 1.14
+ */
+EAPI void ecore_drm_device_pointer_xy_get(Ecore_Drm_Device *dev, int *x, int *y);
+
#endif
return dev->drm.name;
}
+
+EAPI void
+ecore_drm_device_pointer_xy_get(Ecore_Drm_Device *dev, int *x, int *y)
+{
+ Ecore_Drm_Seat *seat;
+ Ecore_Drm_Evdev *edev;
+ Eina_List *l, *ll;
+
+ if (x) *x = 0;
+ if (y) *y = 0;
+
+ /* check for valid device */
+ if ((!dev) || (dev->drm.fd < 0)) return;
+
+ EINA_LIST_FOREACH(dev->seats, l, seat)
+ {
+ EINA_LIST_FOREACH(seat->devices, ll, edev)
+ {
+ if (!libinput_device_has_capability(edev->device,
+ LIBINPUT_DEVICE_CAP_POINTER))
+ continue;
+
+ if (x) *x = edev->mouse.dx;
+ if (y) *y = edev->mouse.dy;
+
+ return;
+ }
+ }
+}