[PATCH 15/15] Initial smooth scrolling support

Peter Hutterer peter.hutterer at who-t.net
Tue Jun 14 14:19:06 PDT 2011


On Tue, Jun 14, 2011 at 05:35:22PM +0100, Daniel Stone wrote:
> Hi,
> 
> On Tue, Jun 14, 2011 at 03:44:44PM +1000, Peter Hutterer wrote:
> > On Thu, Jun 09, 2011 at 08:57:36PM +0100, Daniel Stone wrote:
> > > -#include "synaptics.h"
> > > -#include "synapticsstr.h"
> > > -#include "synaptics-properties.h"
> > > -
> > >  #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
> > >  #include <X11/Xatom.h>
> > >  #include <xserver-properties.h>
> > >  #include <ptrveloc.h>
> > >  #endif
> > >  
> > > +#include "synaptics.h"
> > > +#include "synapticsstr.h"
> > > +#include "synaptics-properties.h"
> > 
> > why did this get moved?
> 
> It was originally a hack so that HAVE_SMOOTH_SCROLL worked before I
> included xserver-properties.h from synapticsstr.h, but now it's just
> there to group the X protocol/server includes immediately above
> together, and then the synaptics includes below that.  I could break
> this into a separate patch if you'd like.

yes please. Bump the minimum server requires to 1.7 in configure.ac and you
can skip the GET_ABI_MAJOR >= 7 as well. I think this is a leftover from
HAVE_PROPERTIES anyway, and all 1.7 servers have that and the FLOAT
property.

Cheers,
  Peter

> 
> > > @@ -1081,6 +1093,18 @@ DeviceInit(DeviceIntPtr dev)
> > >              );
> > >      xf86InitValuatorDefaults(dev, 1);
> > >  
> > > +#ifdef HAVE_SMOOTH_SCROLL
> > > +    xf86InitValuatorAxisStruct(dev, 2, axes_labels[2], 0, 0, 0, 0, 0, Relative);
> > > +    xf86InitValuatorDefaults(dev, 2);
> > 
> > don't do this, no-one else does it. for relative axes, initialize it to min 0,
> > max -1 and skip the defaults call.
> 
> Done.
> 
> > > +    priv->scroll_axis_horiz = 2;
> > > +    xf86InitValuatorAxisStruct(dev, 3, axes_labels[3], 0, 0, 0, 0, 0, Relative);
> > > +    xf86InitValuatorDefaults(dev, 3);
> > > +    priv->scroll_axis_vert = 3;
> > > +    priv->scroll_events_mask = valuator_mask_new(MAX_VALUATORS);
> > > +    if (!priv->scroll_events_mask)
> > > +        return !Success;
> > > +#endif
> > > +
> > >      if (!alloc_shm_data(pInfo))
> > >  	return !Success;
> > 
> > this seems to leave the mask hanging now, doesn't it?
> > SynapticsUnInit probably needs the matching free call.
> 
> Fixed.
> 
> Cheers,
> Daniel


More information about the xorg-devel mailing list