summaryrefslogtreecommitdiff
path: root/src/lib/elput/elput_input.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-08-24 11:24:54 -0400
committerChris Michael <cp.michael@samsung.com>2017-08-24 11:28:31 -0400
commitd798eca247b6b2bca5cf83b9a72bc132d35dc1bc (patch)
tree2362d8d3d796708fc4701e9c36f75b96096b8650 /src/lib/elput/elput_input.c
parent9ac1cb4fadadb667483845a1471f091f6a60780c (diff)
elput: Add API to set pointer acceleration speed
Small patch to add an API which can be called to set pointer acceleration speed under Wayland. ref T4736 @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/elput/elput_input.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index 5134a67635..d219eff9ff 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -775,6 +775,41 @@ elput_input_pointer_accel_profile_set(Elput_Manager *manager, const char *seat,
775 } 775 }
776} 776}
777 777
778EAPI void
779elput_input_pointer_accel_speed_set(Elput_Manager *manager, const char *seat, double speed)
780{
781 Elput_Seat *eseat;
782 Elput_Device *edev;
783 Eina_List *l, *ll;
784
785 EINA_SAFETY_ON_NULL_RETURN(manager);
786
787 /* if no seat name is passed in, just use default seat name */
788 if (!seat) seat = "seat0";
789
790 EINA_LIST_FOREACH(manager->input.seats, l, eseat)
791 {
792 if ((eseat->name) && (strcmp(eseat->name, seat)))
793 continue;
794
795 EINA_LIST_FOREACH(eseat->devices, ll, edev)
796 {
797 if (!libinput_device_has_capability(edev->device,
798 LIBINPUT_DEVICE_CAP_POINTER))
799 continue;
800
801 if (libinput_device_config_accel_set_speed(edev->device,
802 speed) !=
803 LIBINPUT_CONFIG_STATUS_SUCCESS)
804 {
805 WRN("Failed to set acceleration speed for device: %s",
806 libinput_device_get_name(edev->device));
807 continue;
808 }
809 }
810 }
811}
812
778EAPI Elput_Seat * 813EAPI Elput_Seat *
779elput_device_seat_get(const Elput_Device *dev) 814elput_device_seat_get(const Elput_Device *dev)
780{ 815{