Call a input_set_default_property() in evdev_device_create if this function is exist
authorJengHyun Kang <jhyuni.kang@samsung.com>
Tue, 12 Jul 2016 08:52:27 +0000 (17:52 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 4 Feb 2025 09:17:48 +0000 (18:17 +0900)
Change-Id: Ib47c6115248204d9ff63ced802c557b1bf5ad5f5

meson.build
src/evdev.c

index c37f45997dc422c851793a0c6f436c7dc49f7ed6..87fa25836a6996a41ad8a512998d95373b9e6c84 100644 (file)
@@ -185,6 +185,11 @@ if dep_ttrace.found()
        config_h.set10('ENABLE_TTRACE', 1)
 endif
 
+############ check udev function  ############
+
+if cc.has_function('input_set_default_property', dependencies : dep_udev)
+       config_h.set10('HAVE_INPUT_SET_DEFAULT_PROPERTY', 1)
+endif
 
 ############ udev bits ############
 
index faba9c35e87ddae89549414dc52e36f72913a6f1..7ce55a6c823fd25c444fd05655e2df0f1c0f7770 100644 (file)
@@ -2436,10 +2436,16 @@ evdev_device_create(struct libinput_seat *seat,
        int rc;
        int fd = -1;
        int unhandled_device = 0;
-       const char *devnode = udev_device_get_devnode(udev_device);
+       const char *devnode;
        char *sysname = str_sanitize(udev_device_get_sysname(udev_device));
        char buf[STRERR_BUFSIZE] = {0, };
 
+#ifdef HAVE_INPUT_SET_DEFAULT_PROPERTY
+       if (input_set_default_property(udev_device) < 0)
+               return NULL;
+#endif
+       devnode = udev_device_get_devnode(udev_device);
+
        if (!devnode) {
                log_info(libinput, "%s: no device node associated\n", sysname);
                goto err;