Call a input_set_default_property() in evdev_device_create if this function is exist 60/79660/2 accepted/tizen/common/20160713.050528 accepted/tizen/ivi/20160712.132120 accepted/tizen/mobile/20160712.132028 accepted/tizen/tv/20160712.132047 accepted/tizen/wearable/20160712.132100 submit/tizen/20160712.085530
authorJengHyun Kang <jhyuni.kang@samsung.com>
Tue, 12 Jul 2016 08:52:27 +0000 (17:52 +0900)
committerJengHyun Kang <jhyuni.kang@samsung.com>
Tue, 12 Jul 2016 08:52:30 +0000 (17:52 +0900)
Change-Id: Ib47c6115248204d9ff63ced802c557b1bf5ad5f5

configure.ac
src/evdev.c

index ed3854657bb7ffde33e282423206835aa45e360b..3a94f2491437d54d98884e68e9be766465040157 100644 (file)
@@ -57,7 +57,7 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
 
 PKG_PROG_PKG_CONFIG()
 PKG_CHECK_MODULES(MTDEV, [mtdev >= 1.1.0])
-PKG_CHECK_MODULES(LIBUDEV, [libudev])
+PKG_CHECK_MODULES(LIBUDEV, [libudev], [HAVE_UDEV="yes"], [HAVE_UDEV="no"])
 PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4])
 AC_CHECK_LIB([m], [atan2])
 AC_CHECK_LIB([rt], [clock_gettime])
@@ -174,6 +174,18 @@ if test "x$have_ttrace" = "xyes"; then
        AC_DEFINE(ENABLE_TTRACE, 1, [ttrace available])
 fi
 
+# Check for udev property
+if test "x$HAVE_UDEV" = "xyes"; then
+       AC_SEARCH_LIBS([input_set_default_property], [udev],
+               [have_udev_property="yes"],
+               [have_udev_property="no"])
+
+       if test "x$have_udev_property" = "xyes"; then
+               AC_DEFINE(HAVE_INPUT_SET_DEFAULT_PROPERTY, 1,
+                       [have input_set_default_property function])
+       fi
+fi
+
 AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" != "x"])
 AM_CONDITIONAL(BUILD_TESTS, [test "x$build_tests" = "xyes"])
 AM_CONDITIONAL(BUILD_DOCS, [test "x$build_documentation" = "xyes"])
index 3872673efc3cf6d4981bfb34d391b64afa077869..3f8708c529360e694ce892fff589ed27017589c8 100644 (file)
@@ -1769,9 +1769,15 @@ 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;
        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);
+
        /* Use non-blocking mode so that we can loop on read on
         * evdev_device_data() until all events on the fd are
         * read.  mtdev_get() also expects this. */