From 72abfb82d266c8634c23a34f7e4b19d02417e836 Mon Sep 17 00:00:00 2001 From: jeon Date: Wed, 9 Sep 2020 19:28:14 +0900 Subject: [PATCH] e_input: use discrete value for wheel axis Change-Id: I71b138292cf6c515b82ee932ce8057fe66a5715d --- src/bin/e_devicemgr.h | 1 - src/bin/e_devicemgr_input.c | 18 +----------------- src/bin/e_input_evdev.c | 4 ++-- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/bin/e_devicemgr.h b/src/bin/e_devicemgr.h index 40345cc..f0767da 100644 --- a/src/bin/e_devicemgr.h +++ b/src/bin/e_devicemgr.h @@ -80,7 +80,6 @@ struct _E_Devicemgr struct { char *identifier; - int wheel_click_angle; } detent; Eina_List *watched_clients; diff --git a/src/bin/e_devicemgr_input.c b/src/bin/e_devicemgr_input.c index 6175a2d..caf2204 100644 --- a/src/bin/e_devicemgr_input.c +++ b/src/bin/e_devicemgr_input.c @@ -119,20 +119,6 @@ _e_devicemgr_detent_set_info(E_Devicemgr_Input_Device *dev) (dev->name && !strncmp(dev->name, DETENT_DEVICE_NAME, sizeof(DETENT_DEVICE_NAME)))) { e_devicemgr->detent.identifier = (char *)eina_stringshare_add(dev->identifier); - dev_list = (Eina_List *)e_input_devices_get(); - EINA_LIST_FOREACH(dev_list, l, device_data) - { - EINA_LIST_FOREACH(device_data->seats, ll, seat) - { - EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), lll, edev) - { - if (!strncmp(e_input_evdev_name_get(edev), DETENT_DEVICE_NAME, sizeof(DETENT_DEVICE_NAME))) - { - e_devicemgr->detent.wheel_click_angle = e_input_evdev_wheel_click_angle_get(edev); - } - } - } - } } } @@ -362,9 +348,7 @@ _e_devicemgr_input_cb_mouse_wheel(void *data, int type, void *event) if (!e_devicemgr_detent_is_detent(ecore_device_name_get(ev->dev))) return ECORE_CALLBACK_PASS_ON; - detent = (int)(ev->z / (e_devicemgr->detent.wheel_click_angle - ? e_devicemgr->detent.wheel_click_angle - : 1)); + detent = ev->z; if (detent == 1 || detent == -1) { diff --git a/src/bin/e_input_evdev.c b/src/bin/e_input_evdev.c index 4618cff..cf9937b 100644 --- a/src/bin/e_input_evdev.c +++ b/src/bin/e_input_evdev.c @@ -978,13 +978,13 @@ _device_handle_axis(struct libinput_device *device, struct libinput_event_pointe axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL; if (libinput_event_pointer_has_axis(event, axis)) - z = libinput_event_pointer_get_axis_value(event, axis); + z = libinput_event_pointer_get_axis_value_discrete(event, axis); axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL; if (libinput_event_pointer_has_axis(event, axis)) { direction = 1; - z = libinput_event_pointer_get_axis_value(event, axis); + z = libinput_event_pointer_get_axis_value_discrete(event, axis); } if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) || -- 2.7.4