On Fri, Mar 11, 2011 at 09:05:34PM -0600, Chris Bagwell wrote:
> I just acked a similar patch from Peter because his addition of nitems
> looked needed and I didn't have time to think in depth about earlier
> patch that caused issue.
> 
> -       if (unset_prop)
> +       if (unset_prop || nitems > 0)
>                XChangeDeviceProperty(dpy, dev, prop, XA_INTEGER, 32,
>                                        PropModeReplace,
>                                        (unsigned char*)data, nitems);
> 
> After see'ing yours, I'm thinking maybe yours is right approach
> although I still not time to think much on it.  When you want to
> unset_prop, its a different function call to delete the property (if I
> recall correctly).  So XChangeDeviceProperty() should be based on
> !unset_prop.
> 
> Peter, hope you have time to investigate.  I kindly withdraw my ack on
> other patch and let you and Jason figure it out.

good point, we should just delete the property. or not, actually since
someone may be double-using it.

Cheers,
  Peter


> 
> On Fri, Mar 11, 2011 at 6:02 PM, Jason Gerecke <killert...@gmail.com> wrote:
> > I just noticed I was unable to map button presses to keys and after
> > some investigation (yay git bisect!) found the following commit
> > caused the bug:
> >
> > 22bc3028effbdc79d426c0b3dcf586734d4c7532
> >
> > It appears the original comment accompaning the argc check was wrong.
> > The original 'if' statement was "if (argc > 0)" which would imply
> > XChangeDeviceProperty was to be called if we were *setting* a property,
> > not *unsetting*.
> >
> > This patch should probably be checked more thoroughly since I haven't
> > actually tried to figure out how this function works. At first glance,
> > it seems like the first "nitems" hunk of 
> > a6b9416148e5423c5a0c2632d88dbee5589615
> > was actually on the right track...
> >
> > Signed-off-by: Jason Gerecke <killert...@gmail.com>
> > ---
> >  tools/xsetwacom.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
> > index 3435389..1d7265d 100644
> > --- a/tools/xsetwacom.c
> > +++ b/tools/xsetwacom.c
> > @@ -1194,7 +1194,7 @@ static void special_map_property(Display *dpy, 
> > XDevice *dev, Atom btnact_prop, i
> >                        fprintf(stderr, "Cannot parse keyword '%s'\n", 
> > words[i]);
> >        }
> >
> > -       if (unset_prop)
> > +       if (!unset_prop)
> >                XChangeDeviceProperty(dpy, dev, prop, XA_INTEGER, 32,
> >                                        PropModeReplace,
> >                                        (unsigned char*)data, nitems);
> > --
> > 1.7.1
> >
> >
> > ------------------------------------------------------------------------------
> > Colocation vs. Managed Hosting
> > A question and answer guide to determining the best fit
> > for your organization - today and in the future.
> > http://p.sf.net/sfu/internap-sfd2d
> > _______________________________________________
> > Linuxwacom-devel mailing list
> > Linuxwacom-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
> >
> 
> ------------------------------------------------------------------------------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
> 
Cheers,
  Peter

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to