Lines 1-24
Link Here
|
1 |
--- src/evdev.c.orig 2015-01-13 14:06:29.000000000 +0100 |
1 |
--- src/evdev.c.orig 2015-03-27 01:35:50 UTC |
2 |
+++ src/evdev.c 2015-01-13 14:11:54.000000000 +0100 |
2 |
+++ src/evdev.c |
3 |
@@ -39,7 +39,9 @@ |
3 |
@@ -37,9 +37,13 @@ |
|
|
4 |
#include <X11/keysym.h> |
5 |
#include <X11/extensions/XI.h> |
4 |
|
6 |
|
|
|
7 |
+#ifdef __linux__ |
5 |
#include <linux/version.h> |
8 |
#include <linux/version.h> |
|
|
9 |
+#endif |
6 |
#include <sys/stat.h> |
10 |
#include <sys/stat.h> |
7 |
+#ifdef __linux__ |
11 |
+#ifdef HAVE_LIBUDEV |
8 |
#include <libudev.h> |
12 |
#include <libudev.h> |
9 |
+#endif |
13 |
+#endif |
10 |
#include <unistd.h> |
14 |
#include <unistd.h> |
11 |
#include <errno.h> |
15 |
#include <errno.h> |
12 |
#include <fcntl.h> |
16 |
#include <fcntl.h> |
13 |
@@ -222,6 +224,7 @@ |
17 |
@@ -222,6 +226,7 @@ EvdevIsDuplicate(InputInfoPtr pInfo) |
14 |
static BOOL |
18 |
static BOOL |
15 |
EvdevDeviceIsVirtual(const char* devicenode) |
19 |
EvdevDeviceIsVirtual(const char* devicenode) |
16 |
{ |
20 |
{ |
17 |
+#ifdef __linux__ |
21 |
+#ifdef HAVE_LIBUDEV |
18 |
struct udev *udev = NULL; |
22 |
struct udev *udev = NULL; |
19 |
struct udev_device *device = NULL; |
23 |
struct udev_device *device = NULL; |
20 |
struct stat st; |
24 |
struct stat st; |
21 |
@@ -252,6 +255,9 @@ |
25 |
@@ -252,6 +257,9 @@ out: |
22 |
udev_device_unref(device); |
26 |
udev_device_unref(device); |
23 |
udev_unref(udev); |
27 |
udev_unref(udev); |
24 |
return rc; |
28 |
return rc; |
Lines 28-34
Link Here
|
28 |
} |
32 |
} |
29 |
|
33 |
|
30 |
#ifndef HAVE_SMOOTH_SCROLLING |
34 |
#ifndef HAVE_SMOOTH_SCROLLING |
31 |
@@ -1078,11 +1084,13 @@ |
35 |
@@ -1086,11 +1094,13 @@ EvdevReadInput(InputInfoPtr pInfo) |
32 |
do { |
36 |
do { |
33 |
rc = libevdev_next_event(pEvdev->dev, LIBEVDEV_READ_FLAG_NORMAL, &ev); |
37 |
rc = libevdev_next_event(pEvdev->dev, LIBEVDEV_READ_FLAG_NORMAL, &ev); |
34 |
if (rc < 0) { |
38 |
if (rc < 0) { |
Lines 44-54
Link Here
|
44 |
break; |
48 |
break; |
45 |
} else if (rc == LIBEVDEV_READ_STATUS_SUCCESS) { |
49 |
} else if (rc == LIBEVDEV_READ_STATUS_SUCCESS) { |
46 |
#ifdef MULTITOUCH |
50 |
#ifdef MULTITOUCH |
47 |
@@ -1436,10 +1444,15 @@ |
51 |
@@ -1470,10 +1480,15 @@ EvdevAddAbsValuatorClass(DeviceIntPtr de |
48 |
continue; |
52 |
continue; |
49 |
|
53 |
|
50 |
abs = libevdev_get_abs_info(pEvdev->dev, axis); |
54 |
abs = libevdev_get_abs_info(pEvdev->dev, axis); |
51 |
+#if defined(__linux__) |
55 |
+#ifdef __linux__ |
52 |
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 30) |
56 |
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 30) |
53 |
/* Kernel provides units/mm, X wants units/m */ |
57 |
/* Kernel provides units/mm, X wants units/m */ |
54 |
resolution = abs->resolution * 1000; |
58 |
resolution = abs->resolution * 1000; |