diff options
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm_device.c')
-rw-r--r-- | src/lib/ecore_drm/ecore_drm_device.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c index 5d0c0bcfe2..89c6b86485 100644 --- a/src/lib/ecore_drm/ecore_drm_device.c +++ b/src/lib/ecore_drm/ecore_drm_device.c | |||
@@ -470,3 +470,32 @@ ecore_drm_device_name_get(Ecore_Drm_Device *dev) | |||
470 | 470 | ||
471 | return dev->drm.name; | 471 | return dev->drm.name; |
472 | } | 472 | } |
473 | |||
474 | EAPI void | ||
475 | ecore_drm_device_pointer_xy_get(Ecore_Drm_Device *dev, int *x, int *y) | ||
476 | { | ||
477 | Ecore_Drm_Seat *seat; | ||
478 | Ecore_Drm_Evdev *edev; | ||
479 | Eina_List *l, *ll; | ||
480 | |||
481 | if (x) *x = 0; | ||
482 | if (y) *y = 0; | ||
483 | |||
484 | /* check for valid device */ | ||
485 | if ((!dev) || (dev->drm.fd < 0)) return; | ||
486 | |||
487 | EINA_LIST_FOREACH(dev->seats, l, seat) | ||
488 | { | ||
489 | EINA_LIST_FOREACH(seat->devices, ll, edev) | ||
490 | { | ||
491 | if (!libinput_device_has_capability(edev->device, | ||
492 | LIBINPUT_DEVICE_CAP_POINTER)) | ||
493 | continue; | ||
494 | |||
495 | if (x) *x = edev->mouse.dx; | ||
496 | if (y) *y = edev->mouse.dy; | ||
497 | |||
498 | return; | ||
499 | } | ||
500 | } | ||
501 | } | ||