<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">diff -aur old/man/tslib.man xf86-input-tslib-0.0.6/man/tslib.man
--- old/man/tslib.man	2009-10-19 21:52:41.000000000 +0700
+++ xf86-input-tslib-0.0.6/man/tslib.man	2014-01-14 15:59:55.745010748 +0700
@@ -22,7 +22,7 @@
 Hal is now supported and allows the touchscreen to operate
 correctly without any need to change \*q/etc/X11/xorg.conf\*q.
 .SH BASIC CONFIGURATIONS
-If hal is not available, the following defaults may be sufficient:
+If hal is not available, the following defaults may be sufficient. If you want to use hal, please comment out the Option \*qDevice\*q.
 .PP
 .nf
 .B "Section \*qInputDevice\*q"
diff -aur old/src/tslib.c xf86-input-tslib-0.0.6/src/tslib.c
--- old/src/tslib.c	2009-10-19 22:07:18.000000000 +0700
+++ xf86-input-tslib-0.0.6/src/tslib.c	2014-01-14 16:06:23.145010933 +0700
@@ -69,6 +69,13 @@
 #define DEFAULT_HEIGHT		240
 #define DEFAULT_WIDTH		320
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) &lt; 12
+#define COLLECT_INPUT_OPTIONS(pInfo, options) xf86CollectInputOptions((pInfo), (options), NULL)
+#else
+#define COLLECT_INPUT_OPTIONS(pInfo, options) xf86CollectInputOptions((pInfo), (options))
+#endif
+
+
 enum { TSLIB_ROTATE_NONE=0, TSLIB_ROTATE_CW=270, TSLIB_ROTATE_UD=180, TSLIB_ROTATE_CCW=90 };
 
 enum button_state { BUTTON_NOT_PRESSED = 0, BUTTON_1_PRESSED = 1, BUTTON_3_CLICK = 3, BUTTON_3_CLICKED=4, BUTTON_EMULATION_OFF=-1 };
@@ -103,12 +110,10 @@
 static void
 PointerControlProc(DeviceIntPtr dev, PtrCtrl * ctrl)
 {
-	ErrorF("%s\n", __FUNCTION__);
-	return;
 }
 
 static Bool
-ConvertProc( LocalDevicePtr local,
+ConvertProc( InputInfoPtr local,
 			 int first,
 			 int num,
 			 int v0,
@@ -137,7 +142,7 @@
     return t;
 }
 
-static void ReadInput (LocalDevicePtr local)
+static void ReadInput (InputInfoPtr local)
 {
 	struct ts_priv *priv = (struct ts_priv *) (local-&gt;private);
 	struct ts_sample samp;
@@ -189,9 +194,9 @@
 			x = samp.x;
 			y = samp.y;
 
-			xf86XInputSetScreen(local, priv-&gt;screen_num,
-					samp.x,
-					samp.y);
+			//xf86XInputSetScreen(local, priv-&gt;screen_num,
+			//		samp.x,
+			//		samp.y); //this API no longer exist in newer Xorg
 
 			xf86PostMotionEvent (local-&gt;dev, TRUE, 0, 2,
 					x, y);
@@ -384,7 +389,11 @@
 					       axiswidth - 1,	/* max val */
 					       axiswidth,	/* resolution */
 					       0,		/* min_res */
-					       axiswidth);	/* max_res */
+					       axiswidth	/* max_res */
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) &gt;= 12
+					       ,Absolute
+#endif
+					       );
 
 		InitValuatorAxisStruct(device, 1,
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) &gt;= 7
@@ -394,7 +403,11 @@
 					       axisheight - 1,	/* max val */
 					       axisheight,	/* resolution */
 					       0,		/* min_res */
-					       axisheight);	/* max_res */
+					       axisheight	/* max_res */
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) &gt;= 12
+					       ,Absolute
+#endif
+					       );
 
 		if (InitProximityClassDeviceStruct (device) == FALSE) {
 			ErrorF ("Unable to allocate EVTouch touchscreen ProximityClassDeviceStruct\n");
@@ -406,6 +419,8 @@
 		xf86MotionHistoryAllocate(pInfo);
 #endif
 
+		if (!InitPtrFeedbackClassDeviceStruct(device, PointerControlProc))
+			return !Success;
 		break;
 
 	case DEVICE_ON:
@@ -434,7 +449,8 @@
 	ErrorF("%s\n", __FUNCTION__);
 	xf86TslibControlProc(pInfo-&gt;dev, DEVICE_OFF);
 	ts_close(priv-&gt;ts);
-	xfree(pInfo-&gt;private);
+	free(pInfo-&gt;private);
+	pInfo-&gt;private = NULL;
 	xf86DeleteInput(pInfo, 0);
 }
 
@@ -443,47 +459,57 @@
  *
  * called when the module subsection is found in XF86Config
  */
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) &gt;= 12
+static int 
+xf86TslibInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+#else
 static InputInfoPtr
 xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
+#endif
 {
 	struct ts_priv *priv;
 	char *s;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) &lt; 12
 	InputInfoPtr pInfo;
+#endif
 
-	priv = xcalloc (1, sizeof (struct ts_priv));
+	priv = calloc (1, sizeof (struct ts_priv));
         if (!priv)
-                return NULL;
+                return BadValue;
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) &lt; 12
 	if (!(pInfo = xf86AllocateInput(drv, 0))) {
-		xfree(priv);
-		return NULL;
+		free(priv);
+		return BadValue;
 	}
 
 	/* Initialise the InputInfoRec. */
 	pInfo-&gt;name = dev-&gt;identifier;
-	pInfo-&gt;type_name = XI_TOUCHSCREEN;
 	pInfo-&gt;flags =
 	    XI86_KEYBOARD_CAPABLE | XI86_POINTER_CAPABLE |
 	    XI86_SEND_DRAG_EVENTS;
-	pInfo-&gt;device_control = xf86TslibControlProc;
-	pInfo-&gt;read_input = ReadInput;
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
 	pInfo-&gt;motion_history_proc = xf86GetMotionEvents;
 	pInfo-&gt;history_size = 0;
 #endif
-	pInfo-&gt;control_proc = NULL;
+	pInfo-&gt;conf_idev = dev;
 	pInfo-&gt;close_proc = NULL;
-	pInfo-&gt;switch_mode = NULL;
 	pInfo-&gt;conversion_proc = ConvertProc;
 	pInfo-&gt;reverse_conversion_proc = NULL;
-	pInfo-&gt;dev = NULL;
 	pInfo-&gt;private_flags = 0;
 	pInfo-&gt;always_core_feedback = 0;
-	pInfo-&gt;conf_idev = dev;
+#endif
+
+	pInfo-&gt;type_name = XI_TOUCHSCREEN;
+	pInfo-&gt;control_proc = NULL;
+	pInfo-&gt;read_input = ReadInput;
+	pInfo-&gt;device_control = xf86TslibControlProc;
+	pInfo-&gt;switch_mode = NULL;
 	pInfo-&gt;private = priv;
+	pInfo-&gt;dev = NULL;
 
 	/* Collect the options, and process the common options. */
-	xf86CollectInputOptions(pInfo, NULL, NULL);
+	COLLECT_INPUT_OPTIONS(pInfo, NULL);
 	xf86ProcessCommonOptions(pInfo, pInfo-&gt;options);
 
 	priv-&gt;screen_num = xf86SetIntOption(pInfo-&gt;options, "ScreenNumber", 0 );
@@ -509,23 +535,31 @@
 		priv-&gt;rotate = TSLIB_ROTATE_NONE;
 	}
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) &lt; 12
  	s = xf86CheckStrOption(dev-&gt;commonOptions, "path", NULL);
+#else
+	s = xf86CheckStrOption(pInfo-&gt;options, "path", NULL);
+#endif
   	if (!s)
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) &lt; 12
 		s = xf86CheckStrOption(dev-&gt;commonOptions, "Device", NULL);
+#else
+		s = xf86CheckStrOption(pInfo-&gt;options, "Device", NULL);
+#endif
  
 	priv-&gt;ts = ts_open(s, 1);
-	xfree(s);
+	free(s);
 
 	if (!priv-&gt;ts) {
 		ErrorF("ts_open failed (device=%s)\n",s);
 		xf86DeleteInput(pInfo, 0);
-		return NULL;
+		return BadValue;
 	}
 
 	if (ts_config(priv-&gt;ts)) {
 		ErrorF("ts_config failed\n");
 		xf86DeleteInput(pInfo, 0);
-		return NULL;
+		return BadValue;
 	}
 
 	pInfo-&gt;fd = ts_fd(priv-&gt;ts);
@@ -535,14 +569,16 @@
 		priv-&gt;state = BUTTON_EMULATION_OFF;
 	}
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) &lt; 12
 	/* Mark the device configured */
 	pInfo-&gt;flags |= XI86_CONFIGURED;
+#endif
 
 	/* Return the configured device */
-	return (pInfo);
+	return Success;
 }
 
-_X_EXPORT InputDriverRec TSLIB = {
+_X_EXPORT InputDriverRec TSLIB_DRV = {
 	1,			/* driver version */
 	"tslib",		/* driver name */
 	NULL,			/* identify */
@@ -579,7 +615,7 @@
 {
 	static Bool Initialised = FALSE;
 
-	xf86AddInputDriver(&amp;TSLIB, module, 0);
+	xf86AddInputDriver(&amp;TSLIB_DRV, module, 0);
 
 	return module;
 }
</pre></body></html>