View | Details | Raw Unified | Return to bug 216270
Collapse All | Expand All

(-)x11-drivers/xf86-input-acecad/Makefile (-1 / +1 lines)
Lines 2-8 Link Here
2
2
3
PORTNAME=	xf86-input-acecad
3
PORTNAME=	xf86-input-acecad
4
PORTVERSION=	1.5.0
4
PORTVERSION=	1.5.0
5
PORTREVISION=	6
5
PORTREVISION=	7
6
CATEGORIES=	x11-drivers
6
CATEGORIES=	x11-drivers
7
7
8
MAINTAINER=	x11@FreeBSD.org
8
MAINTAINER=	x11@FreeBSD.org
(-)x11-drivers/xf86-input-acecad/files/patch-git_01_fd61e53 (+86 lines)
Line 0 Link Here
1
From fd61e53ed08cec2b3af688a55507477f6ef30544 Mon Sep 17 00:00:00 2001
2
From: Cyril Brulebois <kibi@debian.org>
3
Date: Fri, 3 Jun 2011 15:59:14 +0200
4
Subject: =?UTF-8?q?Avoid=20=E2=80=9C'ReverseConvertProc'=20defined=20but?=
5
 =?UTF-8?q?=20not=20used=E2=80=9D=20warning.?=
6
MIME-Version: 1.0
7
Content-Type: text/plain; charset=UTF-8
8
Content-Transfer-Encoding: 8bit
9
10
Move this function next to its unique caller (AceCadPreInit), and only
11
declare/define it when the input ABI is strictly less than 12.
12
13
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
14
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
15
Signed-off-by: Cyril Brulebois <kibi@debian.org>
16
17
diff --git a/src/acecad.c b/src/acecad.c
18
index 6259f21..f5a2213 100644
19
--- src/acecad.c
20
+++ src/acecad.c
21
@@ -370,6 +370,21 @@ SetupProc_fail:
22
     return NULL;
23
 }
24
 
25
+static Bool
26
+ReverseConvertProc (InputInfoPtr local,
27
+        int x, int  y,
28
+        int *valuators)
29
+{
30
+    AceCadPrivatePtr priv = (AceCadPrivatePtr)(local->private);
31
+
32
+    // xf86Msg(X_INFO, "%s: reverse coordinate conversion in : %d, %d\n", local->name, x, y);
33
+    valuators[0] = x * priv->acecadMaxX / screenInfo.screens[0]->width;
34
+    valuators[1] = y * priv->acecadMaxY / screenInfo.screens[0]->height;
35
+    // xf86Msg(X_INFO, "%s: reverse coordinate conversion out: %d, %d\n", local->name, valuators[0], valuators[1]);
36
+
37
+    return TRUE;
38
+}
39
+
40
 static int
41
 NewAceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags)
42
 #else
43
@@ -1071,22 +1086,6 @@ ConvertProc (InputInfoPtr local, int first, int num,
44
 }
45
 
46
 
47
-static Bool
48
-ReverseConvertProc (InputInfoPtr local,
49
-        int x, int  y,
50
-        int *valuators)
51
-{
52
-    AceCadPrivatePtr priv = (AceCadPrivatePtr)(local->private);
53
-
54
-    // xf86Msg(X_INFO, "%s: reverse coordinate conversion in : %d, %d\n", local->name, x, y);
55
-    valuators[0] = x * priv->acecadMaxX / screenInfo.screens[0]->width;
56
-    valuators[1] = y * priv->acecadMaxY / screenInfo.screens[0]->height;
57
-    // xf86Msg(X_INFO, "%s: reverse coordinate conversion out: %d, %d\n", local->name, valuators[0], valuators[1]);
58
-
59
-    return TRUE;
60
-}
61
-
62
-
63
 #define WriteString(str)\
64
     XisbWrite (priv->buffer, (unsigned char *)(str), strlen(str))
65
 
66
diff --git a/src/acecad.h b/src/acecad.h
67
index a2b5c66..bd8e997 100644
68
--- src/acecad.h
69
+++ src/acecad.h
70
@@ -102,12 +102,12 @@ static Bool DeviceClose (DeviceIntPtr);
71
 static Bool DeviceInit (DeviceIntPtr);
72
 static void ReadInput (InputInfoPtr);
73
 static Bool ConvertProc (InputInfoPtr, int, int, int, int, int, int, int, int, int *, int *);
74
-static Bool ReverseConvertProc(InputInfoPtr , int , int , int*);
75
 static Bool QueryHardware (AceCadPrivatePtr);
76
 static void NewPacket (AceCadPrivatePtr priv);
77
 static Bool AceCadGetPacket (AceCadPrivatePtr);
78
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
79
 static InputInfoPtr AceCadPreInit(InputDriverPtr, IDevPtr , int);
80
+static Bool ReverseConvertProc(InputInfoPtr , int , int , int*);
81
 #else
82
 static int AceCadPreInit(InputDriverPtr, InputInfoPtr , int);
83
 #endif
84
-- 
85
cgit v0.10.2
86
(-)x11-drivers/xf86-input-acecad/files/patch-git_02_1fea653 (+34 lines)
Line 0 Link Here
1
From 1fea6530eeca06b0d8d15a9327f87063292e1e6d Mon Sep 17 00:00:00 2001
2
From: Cyril Brulebois <kibi@debian.org>
3
Date: Fri, 3 Jun 2011 15:59:14 +0200
4
Subject: Silence gcc: report_{x, y} are getting initialized.
5
6
Get us rid of:
7
|   CC     acecad.lo
8
| acecad.c: In function 'USBReadInput':
9
| acecad.c:1052:43: warning: 'report_y' may be used uninitialized in this function [-Wuninitialized]
10
| acecad.c:1052:43: warning: 'report_x' may be used uninitialized in this function [-Wuninitialized]
11
12
Both code paths (with XORG_BOTCHED_INPUT or not) will lead report_x and
13
report_y to be set, but make sure the compiler stops guessing.
14
15
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
16
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
17
Signed-off-by: Cyril Brulebois <kibi@debian.org>
18
19
diff --git a/src/acecad.c b/src/acecad.c
20
index f5a2213..1e2f0c0 100644
21
--- src/acecad.c
22
+++ src/acecad.c
23
@@ -919,7 +919,7 @@ USBReadInput (InputInfoPtr local)
24
     int x = priv->acecadOldX;
25
     int y = priv->acecadOldY;
26
     int z = priv->acecadOldZ;
27
-    int report_x, report_y;
28
+    int report_x = 0, report_y = 0;
29
     int prox = priv->acecadOldProximity;
30
     int buttons = priv->acecadOldButtons;
31
     int is_core_pointer = 0;
32
-- 
33
cgit v0.10.2
34
(-)x11-drivers/xf86-input-acecad/files/patch-git_04_ef1e9cf (+165 lines)
Line 0 Link Here
1
From ef1e9cf34e8f1ec2513dd6bd36d824b54e841ea7 Mon Sep 17 00:00:00 2001
2
From: Cyril Brulebois <kibi@debian.org>
3
Date: Fri, 3 Jun 2011 15:59:15 +0200
4
Subject: Drop support for pre-input ABI 12 servers.
5
6
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
8
Signed-off-by: Cyril Brulebois <kibi@debian.org>
9
10
diff --git a/configure.ac b/configure.ac
11
index 4c76754..d4a404d 100644
12
--- configure.ac
13
+++ configure.ac
14
@@ -55,7 +55,7 @@ AC_CHECK_HEADERS([linux/input.h sysfs/libsysfs.h])
15
 XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
16
 
17
 # Obtain compiler/linker options from server and required extensions
18
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto kbproto inputproto $REQUIRED_MODULES)
19
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto kbproto inputproto $REQUIRED_MODULES)
20
 
21
 # Define a configure option for an alternate input module directory
22
 AC_ARG_WITH(xorg-module-dir,
23
diff --git a/src/acecad.c b/src/acecad.c
24
index d60b3b6..17e141f 100644
25
--- src/acecad.c
26
+++ src/acecad.c
27
@@ -90,6 +90,10 @@
28
 #endif
29
 #define DBG(lvl, f) {if ((lvl) <= xf86GetVerbosity()) f;}
30
 
31
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
32
+#error "XINPUT ABI 12 required."
33
+#endif
34
+
35
 /*****************************************************************************
36
  *	Local Headers
37
  ****************************************************************************/
38
@@ -331,66 +335,8 @@ ProbeFound:
39
 
40
 #endif
41
 
42
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
43
-static int NewAceCadPreInit(InputDriverPtr drv, InputInfoPtr dev, int flags);
44
-
45
-static InputInfoPtr
46
-AceCadPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
47
-{
48
-    InputInfoPtr local = xf86AllocateInput(drv, 0);
49
-    AceCadPrivatePtr priv = calloc (1, sizeof(AceCadPrivateRec));
50
-
51
-    if ((!local))
52
-        goto SetupProc_fail;
53
-
54
-    local->name = dev->identifier;
55
-    local->type_name = XI_TABLET;
56
-    local->flags = XI86_SEND_DRAG_EVENTS;
57
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
58
-    local->motion_history_proc = xf86GetMotionEvents;
59
-#endif
60
-    local->control_proc = NULL;
61
-    local->switch_mode = NULL;
62
-    local->conversion_proc = ConvertProc;
63
-    local->reverse_conversion_proc = ReverseConvertProc;
64
-    local->dev = NULL;
65
-    local->private = priv;
66
-    local->private_flags = 0;
67
-    local->conf_idev = dev;
68
-    /*local->always_core_feedback = 0;*/
69
-
70
-    xf86CollectInputOptions(local, default_options, NULL);
71
-
72
-    xf86OptionListReport(local->options);
73
-
74
-    if (NewAceCadPreInit(drv, local, flags) == Success)
75
-        return local;
76
-
77
-SetupProc_fail:
78
-    return NULL;
79
-}
80
-
81
-static Bool
82
-ReverseConvertProc (InputInfoPtr local,
83
-        int x, int  y,
84
-        int *valuators)
85
-{
86
-    AceCadPrivatePtr priv = (AceCadPrivatePtr)(local->private);
87
-
88
-    // xf86Msg(X_INFO, "%s: reverse coordinate conversion in : %d, %d\n", local->name, x, y);
89
-    valuators[0] = x * priv->acecadMaxX / screenInfo.screens[0]->width;
90
-    valuators[1] = y * priv->acecadMaxY / screenInfo.screens[0]->height;
91
-    // xf86Msg(X_INFO, "%s: reverse coordinate conversion out: %d, %d\n", local->name, valuators[0], valuators[1]);
92
-
93
-    return TRUE;
94
-}
95
-
96
-static int
97
-NewAceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags)
98
-#else
99
 static int
100
 AceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags)
101
-#endif
102
 {
103
     AceCadPrivatePtr priv = calloc (1, sizeof(AceCadPrivateRec));
104
     int speed;
105
@@ -500,10 +446,6 @@ AceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags)
106
 
107
     xf86ProcessCommonOptions(local, local->options);
108
 
109
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
110
-    local->flags |= XI86_CONFIGURED;
111
-#endif
112
-
113
     if (local->fd != -1)
114
     {
115
         RemoveEnabledDevice (local->fd);
116
@@ -709,9 +651,6 @@ DeviceInit (DeviceIntPtr dev)
117
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
118
                 axes_labels,
119
 #endif
120
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
121
-                xf86GetMotionEvents,
122
-#endif
123
                 history_size,
124
                 ((priv->flags & ABSOLUTE_FLAG)? Absolute: Relative)|OutOfProximity)
125
             == FALSE)
126
@@ -818,9 +757,6 @@ ReadInput (InputInfoPtr local)
127
     /*xf86Msg(X_INFO, "ACECAD Tablet Read Input\n");*/
128
 
129
     is_absolute = (priv->flags & ABSOLUTE_FLAG);
130
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
131
-    is_core_pointer = xf86IsCorePointer(local->dev);
132
-#endif
133
 
134
     /*
135
      * set blocking to -1 on the first call because we know there is data to
136
@@ -923,9 +859,6 @@ USBReadInput (InputInfoPtr local)
137
     int prox = priv->acecadOldProximity;
138
     int buttons = priv->acecadOldButtons;
139
     int is_core_pointer = 0;
140
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
141
-    is_core_pointer = xf86IsCorePointer(local->dev);
142
-#endif
143
     /* Is autodev active? */
144
     int autodev = priv->flags & AUTODEV_FLAG;
145
     /* Was the device available last time we checked? */
146
diff --git a/src/acecad.h b/src/acecad.h
147
index bd8e997..b9291c7 100644
148
--- src/acecad.h
149
+++ src/acecad.h
150
@@ -105,12 +105,7 @@ static Bool ConvertProc (InputInfoPtr, int, int, int, int, int, int, int, int, i
151
 static Bool QueryHardware (AceCadPrivatePtr);
152
 static void NewPacket (AceCadPrivatePtr priv);
153
 static Bool AceCadGetPacket (AceCadPrivatePtr);
154
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
155
-static InputInfoPtr AceCadPreInit(InputDriverPtr, IDevPtr , int);
156
-static Bool ReverseConvertProc(InputInfoPtr , int , int , int*);
157
-#else
158
 static int AceCadPreInit(InputDriverPtr, InputInfoPtr , int);
159
-#endif
160
 #ifdef HAVE_LINUX_INPUT_H
161
 static void USBReadInput (InputInfoPtr);
162
 static Bool USBQueryHardware (InputInfoPtr);
163
-- 
164
cgit v0.10.2
165
(-)x11-drivers/xf86-input-acecad/files/patch-git_05_21f7f17 (+121 lines)
Line 0 Link Here
1
From 21f7f1705d2c0b46ce19367d5ac8a4c225d755ef Mon Sep 17 00:00:00 2001
2
From: Cyril Brulebois <kibi@debian.org>
3
Date: Fri, 3 Jun 2011 15:59:15 +0200
4
Subject: Remove checks on the ABI now that 12 or higher is required.
5
6
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
8
Signed-off-by: Cyril Brulebois <kibi@debian.org>
9
10
diff --git a/src/acecad.c b/src/acecad.c
11
index 17e141f..de2577e 100644
12
--- src/acecad.c
13
+++ src/acecad.c
14
@@ -79,10 +79,8 @@
15
 #endif
16
 #endif
17
 
18
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
19
 #include <X11/Xatom.h>
20
 #include <xserver-properties.h>
21
-#endif
22
 
23
 /* Previously found in xf86Xinput.h */
24
 #ifdef DBG
25
@@ -130,9 +128,7 @@ _X_EXPORT InputDriverRec ACECAD =
26
 	AceCadPreInit,
27
 	NULL,
28
 	NULL,
29
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
30
 	default_options
31
-#endif
32
 };
33
 
34
 static XF86ModuleVersionInfo VersionRec =
35
@@ -599,7 +595,6 @@ DeviceInit (DeviceIntPtr dev)
36
     AceCadPrivatePtr priv = (AceCadPrivatePtr) (local->private);
37
     unsigned char map[] = {0, 1, 2, 3};
38
     int history_size;
39
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
40
     Atom btn_labels[3];
41
     Atom axes_labels[3];
42
 
43
@@ -618,15 +613,12 @@ DeviceInit (DeviceIntPtr dev)
44
         axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
45
         axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Z);
46
     }
47
-#endif
48
 
49
     xf86MsgVerb(X_INFO, 4, "%s Init\n", local->name);
50
 
51
     /* 3 boutons */
52
     if (InitButtonClassDeviceStruct (dev, 3,
53
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
54
                 btn_labels,
55
-#endif
56
                 map) == FALSE)
57
     {
58
         xf86Msg(X_ERROR, "%s: unable to allocate ButtonClassDeviceStruct\n", local->name);
59
@@ -648,9 +640,7 @@ DeviceInit (DeviceIntPtr dev)
60
 
61
     /* 3 axes */
62
     if (InitValuatorClassDeviceStruct (dev, 3,
63
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
64
                 axes_labels,
65
-#endif
66
                 history_size,
67
                 ((priv->flags & ABSOLUTE_FLAG)? Absolute: Relative)|OutOfProximity)
68
             == FALSE)
69
@@ -663,9 +653,7 @@ DeviceInit (DeviceIntPtr dev)
70
 
71
         InitValuatorAxisStruct(dev,
72
                 0,
73
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
74
                 axes_labels[0],
75
-#endif
76
                 0,			/* min val */
77
 #if XORG_BOTCHED_INPUT
78
                 screenInfo.screens[0]->width,
79
@@ -675,15 +663,11 @@ DeviceInit (DeviceIntPtr dev)
80
                 1000,			/* resolution */
81
                 0,			/* min_res */
82
                 1000			/* max_res */
83
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
84
                 , Absolute
85
-#endif
86
                 );
87
         InitValuatorAxisStruct(dev,
88
                 1,
89
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
90
                 axes_labels[1],
91
-#endif
92
                 0,			/* min val */
93
 #if XORG_BOTCHED_INPUT
94
                 screenInfo.screens[0]->height,
95
@@ -693,23 +677,17 @@ DeviceInit (DeviceIntPtr dev)
96
                 1000,			/* resolution */
97
                 0,			/* min_res */
98
                 1000			/* max_res */
99
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
100
                 , Absolute
101
-#endif
102
                 );
103
         InitValuatorAxisStruct(dev,
104
                 2,
105
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
106
                 axes_labels[2],
107
-#endif
108
                 0,			/* min val */
109
                 priv->acecadMaxZ,	/* max val */
110
                 1000,			/* resolution */
111
                 0,			/* min_res */
112
                 1000		/* max_res */
113
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
114
                 , Absolute
115
-#endif
116
                 );
117
 
118
     }
119
-- 
120
cgit v0.10.2
121
(-)x11-drivers/xf86-input-acecad/files/patch-git_06_9385ae9 (+97 lines)
Line 0 Link Here
1
From 9385ae905aca9e679e698f0491e0bf7e30a35092 Mon Sep 17 00:00:00 2001
2
From: Cyril Brulebois <kibi@debian.org>
3
Date: Fri, 3 Jun 2011 15:59:16 +0200
4
Subject: Remove pointless checks on is_core_pointer.
5
6
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
8
Signed-off-by: Cyril Brulebois <kibi@debian.org>
9
10
diff --git a/src/acecad.c b/src/acecad.c
11
index de2577e..ad6d793 100644
12
--- src/acecad.c
13
+++ src/acecad.c
14
@@ -729,7 +729,7 @@ ReadInput (InputInfoPtr local)
15
 {
16
     int x, y, z;
17
     int prox, buttons;
18
-    int is_core_pointer = 0, is_absolute;
19
+    int is_absolute;
20
     AceCadPrivatePtr priv = (AceCadPrivatePtr) (local->private);
21
 
22
     /*xf86Msg(X_INFO, "ACECAD Tablet Read Input\n");*/
23
@@ -772,11 +772,10 @@ ReadInput (InputInfoPtr local)
24
         if (prox)
25
         {
26
             if (!(priv->acecadOldProximity))
27
-                if (!is_core_pointer)
28
-                {
29
-                    /*xf86Msg(X_INFO, "ACECAD Tablet ProxIN %d %d %d\n",x, y, z);*/
30
-                    xf86PostProximityEvent(local->dev, 1, 0, 3 , x, y, z);
31
-                }
32
+            {
33
+                /*xf86Msg(X_INFO, "ACECAD Tablet ProxIN %d %d %d\n",x, y, z);*/
34
+                xf86PostProximityEvent(local->dev, 1, 0, 3 , x, y, z);
35
+            }
36
 
37
             if ((is_absolute && ((priv->acecadOldX != x) || (priv->acecadOldY != y) || (priv->acecadOldZ != z)))
38
                     || (!is_absolute && (x || y)))
39
@@ -809,12 +808,11 @@ ReadInput (InputInfoPtr local)
40
         }
41
         else
42
         {
43
-            if (!is_core_pointer)
44
-                if (priv->acecadOldProximity)
45
-                {
46
-                    /*xf86Msg(X_INFO, "ACECAD Tablet ProxOUT %d %d %d\n",x, y, z);*/
47
-                    xf86PostProximityEvent(local->dev, 0, 0, 3, x,y,z);
48
-                }
49
+            if (priv->acecadOldProximity)
50
+            {
51
+                /*xf86Msg(X_INFO, "ACECAD Tablet ProxOUT %d %d %d\n",x, y, z);*/
52
+                xf86PostProximityEvent(local->dev, 0, 0, 3, x,y,z);
53
+            }
54
             priv->acecadOldProximity = 0;
55
         }
56
     }
57
@@ -836,7 +834,6 @@ USBReadInput (InputInfoPtr local)
58
     int report_x = 0, report_y = 0;
59
     int prox = priv->acecadOldProximity;
60
     int buttons = priv->acecadOldButtons;
61
-    int is_core_pointer = 0;
62
     /* Is autodev active? */
63
     int autodev = priv->flags & AUTODEV_FLAG;
64
     /* Was the device available last time we checked? */
65
@@ -935,10 +932,9 @@ USBReadInput (InputInfoPtr local)
66
             report_y = y;
67
 #endif
68
             if (!(priv->acecadOldProximity))
69
-                if (!is_core_pointer)
70
-                {
71
-                    xf86PostProximityEvent(local->dev, 1, 0, 3 , report_x, report_y, z);
72
-                }
73
+            {
74
+                xf86PostProximityEvent(local->dev, 1, 0, 3 , report_x, report_y, z);
75
+            }
76
 
77
 
78
             xf86PostMotionEvent(local->dev, 1, 0, 3, report_x, report_y, z);
79
@@ -957,11 +953,10 @@ USBReadInput (InputInfoPtr local)
80
         }
81
         else
82
         {
83
-            if (!is_core_pointer)
84
-                if (priv->acecadOldProximity)
85
-                {
86
-                    xf86PostProximityEvent(local->dev, 0, 0, 3, report_x, report_y, z);
87
-                }
88
+            if (priv->acecadOldProximity)
89
+            {
90
+                xf86PostProximityEvent(local->dev, 0, 0, 3, report_x, report_y, z);
91
+            }
92
             priv->acecadOldProximity = 0;
93
         }
94
 
95
-- 
96
cgit v0.10.2
97
(-)x11-drivers/xf86-input-acecad/files/patch-git_07_ec2c4ea (+25 lines)
Line 0 Link Here
1
From ec2c4ead497133ef20d5ef5a9b481b38e1e0f7a2 Mon Sep 17 00:00:00 2001
2
From: Peter Hutterer <peter.hutterer@who-t.net>
3
Date: Mon, 27 Jun 2011 13:13:54 +1000
4
Subject: Assign local->private after allocating.
5
6
It is detrimental to the user experience when the driver tries to derefernce
7
null pointers.
8
9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10
11
diff --git a/src/acecad.c b/src/acecad.c
12
index ad6d793..604fe91 100644
13
--- src/acecad.c
14
+++ src/acecad.c
15
@@ -343,6 +343,7 @@ AceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags)
16
         return BadAlloc;
17
 
18
     memset(priv, 0, sizeof(AceCadPrivateRec));
19
+    local->private = priv;
20
 
21
     local->device_control = DeviceControl;
22
 
23
-- 
24
cgit v0.10.2
25
(-)x11-drivers/xf86-input-acecad/files/patch-git_08_39b97cc (+26 lines)
Line 0 Link Here
1
From 39b97cc0138417141b245179fc8555bbb365e879 Mon Sep 17 00:00:00 2001
2
From: Peter Hutterer <peter.hutterer@who-t.net>
3
Date: Fri, 8 Jul 2011 12:24:16 +1000
4
Subject: Always set the type name.
5
6
The server assigns "UNKNOWN", override it with something more specific.
7
8
Introduced in f85c4b580c074f7054eac98753d1f4e91f08305e.
9
10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11
12
diff --git a/src/acecad.c b/src/acecad.c
13
index 604fe91..2b6aa45 100644
14
--- src/acecad.c
15
+++ src/acecad.c
16
@@ -346,6 +346,7 @@ AceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags)
17
     local->private = priv;
18
 
19
     local->device_control = DeviceControl;
20
+    local->type_name = XI_TABLET;
21
 
22
     priv->acecadInc = xf86SetIntOption(local->options, "Increment", 0 );
23
 
24
-- 
25
cgit v0.10.2
26
(-)x11-drivers/xf86-input-acecad/files/patch-git_09_e76e20d (+26 lines)
Line 0 Link Here
1
From e76e20d4d4a39e139a778411a2ed09ec35c2046e Mon Sep 17 00:00:00 2001
2
From: Peter Hutterer <peter.hutterer@who-t.net>
3
Date: Tue, 19 Jul 2011 09:29:28 +1000
4
Subject: Dont call xf86DeleteInput on PreInit failure.
5
6
The server calls this for us once PreInit returns with an error,
7
calling it during PreInit means the server continues to use
8
already free'd memory.
9
10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11
12
diff --git a/src/acecad.c b/src/acecad.c
13
index 2b6aa45..a3326a0 100644
14
--- src/acecad.c
15
+++ src/acecad.c
16
@@ -471,7 +471,6 @@ SetupProc_fail:
17
 	if (local)
18
 		local->private = NULL;
19
     }
20
-    xf86DeleteInput(local, 0);
21
     return BadAlloc;
22
 }
23
 
24
-- 
25
cgit v0.10.2
26
(-)x11-drivers/xf86-input-acecad/files/patch-git_10_2f1a5b4 (+72 lines)
Line 0 Link Here
1
From 2f1a5b44f62028f2608c0c94e58154df09e9ada3 Mon Sep 17 00:00:00 2001
2
From: Peter Hutterer <peter.hutterer@who-t.net>
3
Date: Tue, 19 Jul 2011 14:13:33 +1000
4
Subject: Don't free anything in PreInit, provide an UnInit instead.
5
6
Also fixes:
7
- leaking priv->buffer
8
- fd closure bug
9
10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11
12
diff --git a/src/acecad.c b/src/acecad.c
13
index a3326a0..6a0b347 100644
14
--- src/acecad.c
15
+++ src/acecad.c
16
@@ -126,7 +126,7 @@ _X_EXPORT InputDriverRec ACECAD =
17
 	"acecad",
18
 	NULL,
19
 	AceCadPreInit,
20
-	NULL,
21
+	AceCadUnInit,
22
 	NULL,
23
 	default_options
24
 };
25
@@ -462,16 +462,26 @@ AceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags)
26
      * If something went wrong, cleanup and return NULL
27
      */
28
 SetupProc_fail:
29
-    if ((local) && (local->fd))
30
+    return BadAlloc;
31
+}
32
+
33
+static void
34
+AceCadUnInit(InputDriverPtr drv, InputInfoPtr local, int flags)
35
+{
36
+    AceCadPrivatePtr priv = (AceCadPrivatePtr) (local->private);
37
+
38
+    if (local->fd > -1)
39
+    {
40
         xf86CloseSerial (local->fd);
41
-    if ((priv) && (priv->buffer))
42
-        XisbFree (priv->buffer);
43
+        local->fd = -1;
44
+    }
45
+
46
     if (priv) {
47
+        if (priv->buffer)
48
+            XisbFree (priv->buffer);
49
         free (priv);
50
-	if (local)
51
-		local->private = NULL;
52
+        local->private = NULL;
53
     }
54
-    return BadAlloc;
55
 }
56
 
57
 static Bool
58
diff --git a/src/acecad.h b/src/acecad.h
59
index b9291c7..48fa38a 100644
60
--- src/acecad.h
61
+++ src/acecad.h
62
@@ -106,6 +106,7 @@ static Bool QueryHardware (AceCadPrivatePtr);
63
 static void NewPacket (AceCadPrivatePtr priv);
64
 static Bool AceCadGetPacket (AceCadPrivatePtr);
65
 static int AceCadPreInit(InputDriverPtr, InputInfoPtr , int);
66
+static void AceCadUnInit(InputDriverPtr, InputInfoPtr , int);
67
 #ifdef HAVE_LINUX_INPUT_H
68
 static void USBReadInput (InputInfoPtr);
69
 static Bool USBQueryHardware (InputInfoPtr);
70
-- 
71
cgit v0.10.2
72
(-)x11-drivers/xf86-input-acecad/files/patch-src_acecad.c (+31 lines)
Line 0 Link Here
1
# Finish converting RemoveEnabledDevice to xf86RemoveEnabledDevice
2
#
3
--- src/acecad.c.orig	2016-11-24 00:26:03 UTC
4
+++ src/acecad.c
5
@@ -491,7 +491,7 @@ AceCadPreInit(InputDriverPtr drv, InputI
6
 
7
     if (local->fd != -1)
8
     {
9
-        RemoveEnabledDevice (local->fd);
10
+        xf86RemoveEnabledDevice (local);
11
         if (priv->buffer)
12
         {
13
             XisbFree(priv->buffer);
14
@@ -499,7 +499,7 @@ AceCadPreInit(InputDriverPtr drv, InputI
15
         }
16
         xf86CloseSerial(local->fd);
17
     }
18
-    RemoveEnabledDevice (local->fd);
19
+    xf86RemoveEnabledDevice (local);
20
     local->fd = -1;
21
     return Success;
22
 
23
@@ -601,7 +601,7 @@ DeviceOff (DeviceIntPtr dev)
24
 
25
     if (local->fd != -1)
26
     {
27
-        RemoveEnabledDevice (local->fd);
28
+        xf86RemoveEnabledDevice (local);
29
         if (priv->buffer)
30
         {
31
             XisbFree(priv->buffer);

Return to bug 216270