package: require libinput version 1.19 30/324030/2
authorduna.oh <duna.oh@samsung.com>
Mon, 12 May 2025 10:29:31 +0000 (19:29 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 12 May 2025 11:08:23 +0000 (11:08 +0000)
Change-Id: Ia747da7f36ad816104da67df260523ab11c06540

configure.ac
src/bin/inputmgr/e_input_backend.c
src/bin/inputmgr/e_input_evdev.c
src/bin/inputmgr/e_input_evdev_intern.h

index 7e27e2c84ca7bbf2edd73c07807e2fbf7ed72b04..3e26fb1bca46a07e004f36d20b947b4be9768ee1 100755 (executable)
@@ -295,7 +295,7 @@ e_requires="\
   eldbus >= $efl_version \
   eio >= $efl_version \
   eo >= $efl_version \
-  libinput \
+  libinput >= 1.19.0 \
   libudev \
   libtbm \
   libtdm >= "1.0.0" \
@@ -537,18 +537,6 @@ AM_CONDITIONAL([HAVE_SYSTEMD], [test "x${have_systemd}" = "xyes"])
 #libinput
 PKG_CHECK_MODULES([LIBINPUT], [libinput])
 
-have_extra_touch_event="no"
-AC_CHECK_LIB(input, libinput_event_touch_get_major, [have_extra_touch_event="yes"])
-if test "x${have_extra_touch_event}" = "xyes";then
-AC_DEFINE_UNQUOTED([LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT], [1], [libinput support extra touch event])
-fi
-
-have_scroll_value_v120="no"
-AC_CHECK_LIB(input, libinput_event_pointer_get_scroll_value_v120, [have_scroll_value_v120="yes"])
-if test "x${have_scroll_value_v120}" = "xyes";then
-AC_DEFINE_UNQUOTED([LIBINPUT_HAVE_SCROLL_VALUE_V120], [1], [libinput have get_scroll_value_v120])
-fi
-
 #capi-system-device
 PKG_CHECK_MODULES([CAPI_SYSTEM_DEVICE],
                   [capi-system-device])
index 4591aedd3ef24154a5233c2823be7b0db107bc6a..6ae361a30995aee5fd40e1144bef59872996b088 100644 (file)
@@ -874,11 +874,8 @@ _e_input_backend_libinput_event_evdev_process(struct libinput_event *event)
         e_input_evdev_handle_button(evdev, libinput_event_get_pointer_event(event));
         break;
       case LIBINPUT_EVENT_POINTER_AXIS:
-#if !LIBINPUT_HAVE_SCROLL_VALUE_V120
-        e_input_evdev_handle_axis(evdev, libinput_event_get_pointer_event(event));
-#endif
+        /* This event will be ignored and replaced by SCROLL_XXX events*/
         break;
-#if LIBINPUT_HAVE_SCROLL_VALUE_V120
       case LIBINPUT_EVENT_POINTER_SCROLL_WHEEL:
         e_input_evdev_handle_axis_v120(evdev, libinput_event_get_pointer_event(event), E_INPUT_EVDEV_AXIS_SOURCE_WHEEL);
         break;
@@ -888,7 +885,6 @@ _e_input_backend_libinput_event_evdev_process(struct libinput_event *event)
       case LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS:
         e_input_evdev_handle_axis_v120(evdev, libinput_event_get_pointer_event(event), E_INPUT_EVDEV_AXIS_SOURCE_CONTINUOUS);
         break;
-#endif
       case LIBINPUT_EVENT_TOUCH_DOWN:
         e_input_evdev_handle_touch_down(evdev, libinput_event_get_touch_event(event));
         break;
index 7c736c728e27eb6ed89cc0bcfc4d662835f6c098..bdabf52cadb32bcd55cd43f60c1f893c4859e085 100644 (file)
@@ -1373,148 +1373,6 @@ e_input_evdev_handle_button(E_Input_Evdev *evdev, struct libinput_event_pointer
    _input_event_add(evdev, state? ECORE_EVENT_MOUSE_BUTTON_DOWN : ECORE_EVENT_MOUSE_BUTTON_UP, EINA_FALSE, ev, _e_input_event_mouse_button_cb_free, NULL);
 }
 
-#if !LIBINPUT_HAVE_SCROLL_VALUE_V120
-static int
-_axis_value_get(struct libinput_event_pointer *pointer_event, enum libinput_pointer_axis axis)
-{
-   enum libinput_pointer_axis_source source;
-   double value = 0.0, value_discrete = 0.0;
-   int ret = 0;
-   E_Comp_Config *comp_conf = NULL;
-
-   comp_conf = e_comp_config_get();
-   source = libinput_event_pointer_get_axis_source(pointer_event);
-   switch (source)
-     {
-      case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL:
-        value_discrete = libinput_event_pointer_get_axis_value_discrete(pointer_event, axis);
-        value = libinput_event_pointer_get_axis_value(pointer_event, axis);
-        if (comp_conf && comp_conf->input_log_enable)
-          {
-             ELOGF("Axis", "SOURCE_WHEEL discrete: %lf (cf. value: %lf)", NULL, value_discrete, value);
-          }
-        ret = (int)value_discrete;
-        break;
-      case LIBINPUT_POINTER_AXIS_SOURCE_FINGER:
-      case LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS:
-        value = libinput_event_pointer_get_axis_value(pointer_event, axis);
-        if (comp_conf && comp_conf->input_log_enable)
-          {
-             ELOGF("Axis", "SOURCE_FINGER/CONTINUOUS value: %lf", NULL, value);
-          }
-        if (value >= E_INPUT_FINGER_SCROLL_THRESHOLD)
-          ret = 1;
-        else if (value <= E_INPUT_FINGER_SCROLL_THRESHOLD * (-1))
-          ret = -1;
-        else
-          ret = 0;
-        break;
-      default:
-        break;
-     }
-
-   return ret;
-}
-
-EINTERN void
-e_input_evdev_handle_axis(E_Input_Evdev *evdev, struct libinput_event_pointer *event)
-{
-   E_Input_Backend *input;
-   Ecore_Event_Mouse_Wheel *ev;
-   uint32_t timestamp;
-   enum libinput_pointer_axis axis;
-   Ecore_Device *ecore_dev = NULL, *detent_data = NULL, *data;
-   Eina_List *l;
-   E_Comp_Config *comp_conf = NULL;
-   int direction = 0, z = 0;
-   const char *device_name = NULL;
-   E_Input_Event_Info *input_event = NULL;
-
-   EINA_SAFETY_ON_NULL_RETURN(evdev);
-
-   if (!(input = e_input_seat_input_get(evdev->seat)))
-     {
-        return;
-     }
-
-   device_name = evdev->name;
-   timestamp = libinput_event_pointer_get_time(event);
-
-   axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
-   if (libinput_event_pointer_has_axis(event, axis))
-     z = _axis_value_get(event, axis);
-
-   axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL;
-   if (libinput_event_pointer_has_axis(event, axis))
-     {
-        direction = 1;
-        z = _axis_value_get(event, axis);
-     }
-
-  if (z == 0)
-    {
-       ELOGF("Mouse", "Axis event is ignored since it has zero value", NULL);
-       return;
-    }
-
-   comp_conf = e_comp_config_get();
-   if (comp_conf && comp_conf->e_wheel_click_angle)
-     {
-        z = (int)(z * comp_conf->e_wheel_click_angle);
-     }
-
-   if ((evdev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
-       (evdev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
-     {
-        void *blocked_client = atomic_load(&evdev->seat->dev->blocked_client);
-
-        if (detent_data)
-          ELOGF("Mouse", "Detent (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
-                direction, z, blocked_client, evdev->seat->dev->server_blocked);
-        else
-          ELOGF("Mouse", "Wheel (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
-                direction, z, blocked_client, evdev->seat->dev->server_blocked);
-
-        return;
-     }
-
-   if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Wheel)))) return;
-
-   ev->window = (Ecore_Window)input->dev->window;
-   ev->event_window = (Ecore_Window)input->dev->window;
-   ev->root_window = (Ecore_Window)input->dev->window;
-   ev->timestamp = timestamp;
-   ev->same_screen = 1;
-
-   _device_modifiers_update(evdev);
-   ev->modifiers = evdev->xkb.modifiers;
-
-   ev->x = e_input_seat_pointer_ix_get(evdev->seat);
-   ev->y = e_input_seat_pointer_iy_get(evdev->seat);
-   ev->root.x = ev->x;
-   ev->root.y = ev->y;
-   ev->z = z;
-   ev->direction = direction;
-
-   if (comp_conf && comp_conf->input_log_enable)
-     {
-        if (detent_data)
-          ELOGF("Mouse", "Detent (direction: %d, value: %d)", NULL, ev->direction, ev->z);
-        else
-          ELOGF("Mouse", "Wheel (direction: %d, value: %d)", NULL, ev->direction, ev->z);
-     }
-
-   if (e_input_thread_mode_get() && e_input_pointer_thread_mode_get())
-     {
-        e_dev = _input_thread_mode_pointer_device_get(evdev);
-        ev->dev = (Eo *)g_object_ref(e_dev);
-     }
-
-   _input_event_add(evdev, ECORE_EVENT_MOUSE_WHEEL, EINA_FALSE, ev, _e_input_event_mouse_wheel_cb_free, NULL);
-}
-#endif
-
-#if LIBINPUT_HAVE_SCROLL_VALUE_V120
 static int
 _scroll_value_get(struct libinput_event_pointer *pointer_event, enum libinput_pointer_axis axis, E_Input_Evdev_Axis_Source source)
 {
@@ -1661,7 +1519,6 @@ e_input_evdev_handle_axis_v120(E_Input_Evdev *evdev, struct libinput_event_point
 
    _input_event_add(evdev, ECORE_EVENT_MOUSE_WHEEL, EINA_FALSE, ev, _e_input_event_mouse_wheel_cb_free, NULL);
 }
-#endif
 
 static E_Device *
 _input_thread_mode_touch_device_get(E_Input_Evdev *evdev)
@@ -1868,7 +1725,6 @@ _device_handle_touch_event_send(E_Input_Evdev *evdev, struct libinput_event_touc
    if (!(input = e_input_seat_input_get(evdev->seat))) return;
 
    timestamp = libinput_event_touch_get_time(event);
-#if LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT
    if (libinput_event_get_type(libinput_event_touch_get_base_event(event))
        == LIBINPUT_EVENT_TOUCH_DOWN)
      {
@@ -1881,7 +1737,6 @@ _device_handle_touch_event_send(E_Input_Evdev *evdev, struct libinput_event_touc
         if (libinput_event_touch_has_orientation(event))
           angle = libinput_event_touch_get_orientation(event);
      }
-#endif
 
    if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Button)))) return;
 
@@ -1981,7 +1836,6 @@ _device_handle_touch_motion_send(E_Input_Evdev *evdev, struct libinput_event_tou
    e_input_hook_call(E_INPUT_HOOK_BOOST_MAIN_THREAD, NULL);
 
    timestamp = libinput_event_touch_get_time(event);
-#if LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT
    if (libinput_event_touch_has_minor(event))
      radius_x = libinput_event_touch_get_minor(event);
    if (libinput_event_touch_has_major(event))
@@ -1990,7 +1844,6 @@ _device_handle_touch_motion_send(E_Input_Evdev *evdev, struct libinput_event_tou
      pressure = libinput_event_touch_get_pressure(event);
    if (libinput_event_touch_has_orientation(event))
      angle = libinput_event_touch_get_orientation(event);
-#endif
 
    if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
 
index b5e19275caa2cb82dbeae79d58243a1b17c5d000..36e418501729bea227c37bfa4dc354e264a545fc 100644 (file)
@@ -122,7 +122,6 @@ EINTERN void e_input_evdev_handle_key(E_Input_Evdev *evdev, struct libinput_even
 EINTERN void e_input_evdev_handle_pointer_motion(E_Input_Evdev *evdev, struct libinput_event_pointer *event);
 EINTERN void e_input_evdev_handle_pointer_motion_absolute(E_Input_Evdev *evdev, struct libinput_event_pointer *event);
 EINTERN void e_input_evdev_handle_button(E_Input_Evdev *evdev, struct libinput_event_pointer *event);
-EINTERN void e_input_evdev_handle_axis(E_Input_Evdev *evdev, struct libinput_event_pointer *event);
 EINTERN void e_input_evdev_handle_axis_v120(E_Input_Evdev *evdev, struct libinput_event_pointer *event, E_Input_Evdev_Axis_Source source);
 EINTERN void e_input_evdev_handle_touch_down(E_Input_Evdev *evdev, struct libinput_event_touch *event);
 EINTERN void e_input_evdev_handle_touch_motion(E_Input_Evdev *evdev, struct libinput_event_touch *event);