Re: [Linuxwacom-devel] [PATCH 1/9] Fix "buttons must be set twice" bug from d650b139

2011-03-30 Thread Eduard Hasenleithner
Hi

I join the discussion, because I have to deal with "Array of Atom"
constructs also for my OLED Images.

2011/3/30 Peter Hutterer :
> applied, but from a cursory glance I'm not sure why. In fact, I would have
> guessed the other way round. anyway, I've added a comment to avoid this in
> the future (at least until we find the reason why and fixed it).

How about that:

When  XChangeDeviceProperty(dpy, dev, btnact_prop, ...) is called for
the first time with a "fresh Action", IMHO the following chall chain
is to be observed for the new Atom in the array of Atoms:

wcmXCommand.c: wcmSetProperty => wcmSetPropertyButtonActions =>
wcmCheckActionProp => XIGetDeviceProperty("fresh Action") => BadValue

which means that the wcmUpdateActionPropHandlers is not called. Since
"priv->btn_actions" is then not up-to-date, setting the actual action
value will not be noticed. This is just based on speculation, not gdb
usage.

Cheers,
Eduard

--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 1/9] Fix "buttons must be set twice" bug from d650b139

2011-03-29 Thread Jason Gerecke
On Tue, Mar 29, 2011 at 9:03 PM, Peter Hutterer
 wrote:
> applied, but from a cursory glance I'm not sure why. In fact, I would have
> guessed the other way round. anyway, I've added a comment to avoid this in
> the future (at least until we find the reason why and fixed it).
>
> Cheers,
>  Peter
>
I thought it was curious as well. I tried things both ways around and
was surprised to see that this was the order that worked.

Jason

---
Day xee-nee-svsh duu-'ushtlh-ts'it;
nuu-wee-ya' duu-xan' 'vm-nvshtlh-ts'it.
Huu-chan xuu naa~-gha.

--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 1/9] Fix "buttons must be set twice" bug from d650b139

2011-03-29 Thread Peter Hutterer
On Tue, Mar 29, 2011 at 04:18:30PM -0700, Jason Gerecke wrote:
> *facepalm* I simply can't believe I didn't test this, but there's
> no denying the bug exists. Looks like the change to 'btnact_prop'
> *must* occur after the change to 'prop'. If it happens beforehand,
> then the driver appears to be eternally one step behind xsetwacom.
> 
> Signed-off-by: Jason Gerecke 
> ---

applied, but from a cursory glance I'm not sure why. In fact, I would have
guessed the other way round. anyway, I've added a comment to avoid this in
the future (at least until we find the reason why and fixed it).

Cheers,
  Peter

>  tools/xsetwacom.c |   14 +++---
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
> index 1cc3da9..f545f95 100644
> --- a/tools/xsetwacom.c
> +++ b/tools/xsetwacom.c
> @@ -1236,17 +1236,17 @@ static void special_map_property(Display *dpy, 
> XDevice *dev, Atom btnact_prop, i
>   sprintf(buff, "Wacom button action %d", (offset + 1));
>   prop = XInternAtom(dpy, buff, False);
>   btnact_data[offset] = prop;
> + }
>  
> - XChangeDeviceProperty(dpy, dev, btnact_prop, XA_ATOM, 
> 32,
> +
> + XChangeDeviceProperty(dpy, dev, prop, XA_INTEGER, 32,
> + PropModeReplace,
> + (unsigned char*)data, nitems);
> +
> + XChangeDeviceProperty(dpy, dev, btnact_prop, XA_ATOM, 32,
>   PropModeReplace,
>   (unsigned char*)btnact_data,
>   btnact_nitems);
> - }
> -
> -
> - XChangeDeviceProperty(dpy, dev, prop, XA_INTEGER, 32,
> - PropModeReplace,
> - (unsigned char*)data, nitems);
>   }
>   else if (prop)
>   { /* Unsetting a property that exists */
> -- 
> 1.7.4.1

--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 1/9] Fix "buttons must be set twice" bug from d650b139

2011-03-29 Thread Jason Gerecke
*facepalm* I simply can't believe I didn't test this, but there's
no denying the bug exists. Looks like the change to 'btnact_prop'
*must* occur after the change to 'prop'. If it happens beforehand,
then the driver appears to be eternally one step behind xsetwacom.

Signed-off-by: Jason Gerecke 
---
 tools/xsetwacom.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
index 1cc3da9..f545f95 100644
--- a/tools/xsetwacom.c
+++ b/tools/xsetwacom.c
@@ -1236,17 +1236,17 @@ static void special_map_property(Display *dpy, XDevice 
*dev, Atom btnact_prop, i
sprintf(buff, "Wacom button action %d", (offset + 1));
prop = XInternAtom(dpy, buff, False);
btnact_data[offset] = prop;
+   }
 
-   XChangeDeviceProperty(dpy, dev, btnact_prop, XA_ATOM, 
32,
+
+   XChangeDeviceProperty(dpy, dev, prop, XA_INTEGER, 32,
+   PropModeReplace,
+   (unsigned char*)data, nitems);
+
+   XChangeDeviceProperty(dpy, dev, btnact_prop, XA_ATOM, 32,
PropModeReplace,
(unsigned char*)btnact_data,
btnact_nitems);
-   }
-
-
-   XChangeDeviceProperty(dpy, dev, prop, XA_INTEGER, 32,
-   PropModeReplace,
-   (unsigned char*)data, nitems);
}
else if (prop)
{ /* Unsetting a property that exists */
-- 
1.7.4.1


--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel