[PATCH synaptics] tools: skip non-existing properties

Peter Hutterer peter.hutterer at who-t.net
Tue Apr 10 17:41:27 PDT 2012


On Tue, Apr 10, 2012 at 05:26:19PM -0700, Chase Douglas wrote:
> On 04/10/2012 05:21 PM, Peter Hutterer wrote:
> > If a property doesn't exist on a device, skip it.
> 
> Does this occur normally? Or does this only happen when mixing and
> matching synaptics input modules and synclients?

happened to me when I was testing two touchpads (synaptics + apple magic
trackpad)

Cheers,
  Peter

> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> >  tools/synclient.c |    9 +++++++++
> >  1 files changed, 9 insertions(+), 0 deletions(-)
> > 
> > diff --git a/tools/synclient.c b/tools/synclient.c
> > index 942312a..aef719f 100644
> > --- a/tools/synclient.c
> > +++ b/tools/synclient.c
> > @@ -446,6 +446,13 @@ dp_set_variables(Display *dpy, XDevice* dev, int argc, char *argv[], int first_c
> >  	XGetDeviceProperty(dpy, dev, prop, 0, 1000, False, AnyPropertyType,
> >  				&type, &format, &nitems, &bytes_after, &data);
> >  
> > +	if (type == None)
> > +	{
> > +	    fprintf(stderr, "Property for '%s' not available. Skipping.\n",
> > +		    par->name);
> > +	    continue;
> > +	}
> > +
> >  	switch(par->prop_format)
> >  	{
> >  	    case 8:
> > @@ -517,6 +524,8 @@ dp_show_settings(Display *dpy, XDevice *dev)
> >  	XGetDeviceProperty(dpy, dev, a, 0, len, False,
> >  				AnyPropertyType, &type, &format,
> >  				&nitems, &bytes_after, &data);
> > +	if (type == None)
> > +	    continue;
> >  
> >  	switch(par->prop_format) {
> >  	    case 8:
> 
> Looks good to me.
> 
> Reviewed-by: Chase Douglas <chase.douglas at canonical.com>



More information about the xorg-devel mailing list