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)
committerDuna Oh <duna.oh@samsung.com>
Mon, 7 Feb 2022 11:52:38 +0000 (20:52 +0900)
Change-Id: Ib47c6115248204d9ff63ced802c557b1bf5ad5f5

meson.build
src/evdev.c

index 25fa15c33d43209d588fed62169ee3bdb1324c73..589d140dd02b053799d54b47cb495fb35e7705c4 100644 (file)
@@ -169,6 +169,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 c11aa3e3a1db940451b75b0cbeda6492740057da..a3fac6c3840fe69f44b076d390e192969122c29d 100644 (file)
@@ -2260,10 +2260,16 @@ evdev_device_create(struct libinput_seat *seat,
        int rc;
        int fd;
        int unhandled_device = 0;
-       const char *devnode = udev_device_get_devnode(udev_device);
+       const char *devnode;
        const char *sysname = 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);
                return NULL;