rpms/linuxwacom/devel linuxwacom-0.8.2.2-HAL.patch, NONE, 1.1 linuxwacom-0.8.2.2-export-module.patch, NONE, 1.1 linuxwacom-0.8.2.2-wcmMaxX.patch, NONE, 1.1 linuxwacom.spec, 1.73, 1.74

Peter Hutterer whot at fedoraproject.org
Mon Mar 2 05:36:56 UTC 2009


Author: whot

Update of /cvs/pkgs/rpms/linuxwacom/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv21907

Modified Files:
	linuxwacom.spec 
Added Files:
	linuxwacom-0.8.2.2-HAL.patch 
	linuxwacom-0.8.2.2-export-module.patch 
	linuxwacom-0.8.2.2-wcmMaxX.patch 
Log Message:
* Mon Mar 02 2009 Peter Hutterer <peter.hutterer at redhat.com> 0.8.2.2-6
- linuxwacom-0.8.2.2-export-module.patch: _X_EXPORT the module data
- linuxwacom-0.8.2.2-wcmMaxX.patch: don't overwrite maxX with 0
- linuxwacom-0.8.2.2-HAL.patch: when coming from HAL




linuxwacom-0.8.2.2-HAL.patch:

--- NEW FILE linuxwacom-0.8.2.2-HAL.patch ---
>From 2d8d337da1215c0b384b73a6966dc21404cac728 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer at redhat.com>
Date: Sat, 28 Feb 2009 00:31:34 +1000
Subject: [PATCH] If no type is given, check if we're coming from HAL and init all devices.

On uninit check which device is being deleted. If it's the stylus, we need to
remove all other devices too.

I feel dirty now.
---
 src/xdrv/wcmConfig.c |  129 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 125 insertions(+), 4 deletions(-)

diff --git a/src/xdrv/wcmConfig.c b/src/xdrv/wcmConfig.c
index b0b310c..50cc79f 100644
--- a/src/xdrv/wcmConfig.c
+++ b/src/xdrv/wcmConfig.c
@@ -365,13 +365,47 @@ static const char *default_options[] =
 static void xf86WcmUninit(InputDriverPtr drv, LocalDevicePtr local, int flags)
 {
 	WacomDevicePtr priv = (WacomDevicePtr) local->private;
-    
+	WacomCommonPtr common = priv->common;
+	WacomDevicePtr dev = common->wcmDevices;
+	WacomDevicePtr *prev = &common->wcmDevices;
+
 	DBG(1, priv->debugLevel, ErrorF("xf86WcmUninit\n"));
 
 #ifndef WCM_XORG_XSERVER_1_4
 	gWacomModule.DevProc(local->dev, DEVICE_OFF);
 #endif
 
+	/* XXX: if we get a read error + HAL removal, it's always the first
+	 * device (the stylus). Removal in CloseDownDevices hits all others
+	 * before the stylus. So we simply check if there's any left to clean
+	 * and do so.
+	 *
+	 * I hate myself.
+	 */
+	if (IsStylus(priv))
+	{
+	    WacomDevicePtr next;
+
+	    while(dev)
+	    {
+		next = dev->next;
+		if (dev != priv)
+		    DeleteInputDeviceRequest(dev->local->dev);
+		dev = next;
+	    }
+	}
+
+	while(dev)
+	{
+	    if (dev == priv)
+	    {
+		*prev = dev->next;
+		break;
+	    }
+	    prev = &dev->next;
+	    dev = dev->next;
+	}
+
 	/* free pressure curve */
 	if (priv->pPressCurve)
 		xfree(priv->pPressCurve);
@@ -423,7 +457,87 @@ static Bool xf86WcmMatchDevice(LocalDevicePtr pMatch, LocalDevicePtr pLocal)
 	return 0;
 }
 
-/* xf86WcmInit - called when the module subsection is found in XF86Config */
+/* Duplicate xf86 options and convert them to InputOption */
+static InputOption *WcmOptionDupConvert(pointer original)
+{
+    InputOption *iopts = NULL, *new;
+    InputInfoRec dummy;
+
+    memset(&dummy, 0, sizeof(dummy));
+    xf86CollectInputOptions(&dummy, NULL, original);
+
+    while(dummy.options)
+    {
+	new = xcalloc(1, sizeof(InputOption));
+
+	new->key = xf86OptionName(dummy.options);
+	new->value = xf86OptionValue(dummy.options);
+	new->next = iopts;
+	iopts = new;
+	dummy.options = xf86NextOption(dummy.options);
+    }
+    return iopts;
+}
+static void WcmFreeInputOpts(InputOption* opts)
+{
+    InputOption *tmp = opts;
+    while(opts)
+    {
+	tmp = opts->next;
+	xfree(opts->key);
+	xfree(opts->value);
+	xfree(opts);
+	opts = tmp;
+    }
+}
+static void WcmReplaceType(InputOption *opts, char *type)
+{
+    while(opts)
+    {
+	if (xf86NameCmp(opts->key, "type") == 0)
+	{
+	    xfree(opts->value);
+	    opts->value = strdup(type);
+	} else if (xf86NameCmp(opts->key, "name") == 0)
+	{
+	    char *tmp = opts->value;
+	    opts->value = xcalloc(strlen(tmp) + strlen(type) + 1, 1);
+	    strcpy(opts->value, tmp);
+	    strcat(opts->value, type);
+	    xfree(tmp);
+	}
+
+	opts = opts->next;
+    }
+}
+
+static void WcmInitOthers(pointer options)
+{
+    DeviceIntPtr dev; /* dummy */
+    InputOption *input_options = NULL;
+
+#if 0 /* This breaks on my box */
+    input_options = WcmOptionDupConvert(options);
+    WcmReplaceType(input_options, " touch");
+    NewInputDeviceRequest(input_options, &dev);
+    WcmFreeInputOpts(input_options);
+#endif
+
+    input_options = WcmOptionDupConvert(options);
+    WcmReplaceType(input_options, " eraser");
+    NewInputDeviceRequest(input_options, &dev);
+    WcmFreeInputOpts(input_options);
+
+    input_options = WcmOptionDupConvert(options);
+    WcmReplaceType(input_options, " cursor");
+    NewInputDeviceRequest(input_options, &dev);
+    WcmFreeInputOpts(input_options);
+
+    input_options = WcmOptionDupConvert(options);
+    WcmReplaceType(input_options, " pad");
+    NewInputDeviceRequest(input_options, &dev);
+    WcmFreeInputOpts(input_options);
+}
 
 static LocalDevicePtr xf86WcmInit(InputDriverPtr drv, IDevPtr dev, int flags)
 {
@@ -451,9 +565,16 @@ static LocalDevicePtr xf86WcmInit(InputDriverPtr drv, IDevPtr dev, int flags)
 	 */
 	xf86CollectInputOptions(fakeLocal, default_options, NULL);
 
-	/* Type is mandatory */
-	s = xf86FindOptionValue(fakeLocal->options, "Type");
+        /* no type was specified - did it come from hal?
+         * If so, claim we're a stylus and init the other devices. */
+	if (!xf86FindOption(fakeLocal->options, "Type") &&
+            !strcmp(xf86CheckStrOption(fakeLocal->options, "_source", ""), "server/hal"))
+        {
+            fakeLocal->options = xf86AddNewOption(fakeLocal->options, "Type", "stylus");
+	    WcmInitOthers(fakeLocal->options);
+	}
 
+	s = xf86FindOptionValue(fakeLocal->options, "Type");
 	if (s && (xf86NameCmp(s, "stylus") == 0))
 		local = xf86WcmAllocateStylus();
 	else if (s && (xf86NameCmp(s, "touch") == 0))
-- 
1.6.0.5


linuxwacom-0.8.2.2-export-module.patch:

--- NEW FILE linuxwacom-0.8.2.2-export-module.patch ---
>From 7e183aad99bde7c2a2c96cfd0406c676f620b368 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer at redhat.com>
Date: Fri, 27 Feb 2009 23:13:14 +1000
Subject: [PATCH] _X_EXPORT the module data.

---
 src/xdrv/wcmConfig.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/xdrv/wcmConfig.c b/src/xdrv/wcmConfig.c
index 9950932..d2d675c 100644
--- a/src/xdrv/wcmConfig.c
+++ b/src/xdrv/wcmConfig.c
@@ -1088,7 +1088,7 @@ static XF86ModuleVersionInfo xf86WcmVersionRec =
 	{0, 0, 0, 0}  /* signature, to be patched into the file by a tool */
 };
 
-XF86ModuleData wacomModuleData =
+_X_EXPORT XF86ModuleData wacomModuleData =
 {
 	&xf86WcmVersionRec,
 	xf86WcmPlug,
-- 
1.6.0.5


linuxwacom-0.8.2.2-wcmMaxX.patch:

--- NEW FILE linuxwacom-0.8.2.2-wcmMaxX.patch ---
>From 988744b8ccb22d49c6971e15eac7ce414a037664 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer at redhat.com>
Date: Sat, 28 Feb 2009 01:57:10 +1000
Subject: [PATCH] Don't assign priv->wcmMaxX/Y back into common->wcmMaxX/Y.

Otherwise we overwrite the settings read from the tablet with a nice 0, which
is rather pointless, isn't it?

Signed-off-by: Peter Hutterer <peter.hutterer at redhat.com>
---
 src/xdrv/wcmConfig.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xdrv/wcmConfig.c b/src/xdrv/wcmConfig.c
index 1f03d34..9950932 100644
--- a/src/xdrv/wcmConfig.c
+++ b/src/xdrv/wcmConfig.c
@@ -872,7 +872,7 @@ xf86Msg(X_CONFIG, "%s (%s) is not a pad \n", local->name, dev->identifier);
 			common->wcmThreshold);
 
 	priv->wcmMaxX = xf86SetIntOption(local->options, "MaxX",
-		priv->wcmMaxX);
+		common->wcmMaxX);
 	if (priv->wcmMaxX != 0)
 		xf86Msg(X_CONFIG, "%s: max x = %d\n", dev->identifier,
 			priv->wcmMaxX);
@@ -881,7 +881,7 @@ xf86Msg(X_CONFIG, "%s (%s) is not a pad \n", local->name, dev->identifier);
 	if (!IsTouch(priv)) common->wcmMaxX = priv->wcmMaxX;
 
 	priv->wcmMaxY = xf86SetIntOption(local->options, "MaxY",
-		priv->wcmMaxY);
+		common->wcmMaxY);
 	if (priv->wcmMaxY != 0)
 		xf86Msg(X_CONFIG, "%s: max y = %d\n", dev->identifier,
 			priv->wcmMaxY);
-- 
1.6.0.5



Index: linuxwacom.spec
===================================================================
RCS file: /cvs/pkgs/rpms/linuxwacom/devel/linuxwacom.spec,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- linuxwacom.spec	25 Feb 2009 20:36:06 -0000	1.73
+++ linuxwacom.spec	2 Mar 2009 05:36:25 -0000	1.74
@@ -3,7 +3,7 @@
 # Upstream's versioning is goofy.  Note the mapping from tarname to version.
 Name:		linuxwacom
 Version:	0.8.2.2
-Release:	5%{?dist}
+Release:	6%{?dist}
 Summary:	Wacom Drivers from Linux Wacom Project
 
 Group:		User Interface/X Hardware Support
@@ -16,6 +16,9 @@
 Patch2:		linuxwacom-0.7.9.7-fix_build.patch
 Patch3:		linuxwacom-0.8.2.1-fix_build.patch
 Patch4:		linuxwacom-0.8.2.2-fix-mapping.patch
+Patch5:		linuxwacom-0.8.2.2-export-module.patch
+Patch6:		linuxwacom-0.8.2.2-HAL.patch
+Patch7:		linuxwacom-0.8.2.2-wcmMaxX.patch
 
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}
 BuildRequires:	libX11-devel libXi-devel ncurses-devel
@@ -46,6 +49,9 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %build
 
@@ -107,6 +113,11 @@
 %{_libdir}/libwacomcfg*.so
 
 %changelog
+* Mon Mar 02 2009 Peter Hutterer <peter.hutterer at redhat.com> 0.8.2.2-6
+- linuxwacom-0.8.2.2-export-module.patch: _X_EXPORT the module data
+- linuxwacom-0.8.2.2-wcmMaxX.patch: don't overwrite maxX with 0
+- linuxwacom-0.8.2.2-HAL.patch: when coming from HAL
+
 * Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.8.2.2-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 




More information about the scm-commits mailing list