[PATCH] [weston, v4] weston.ini: Add natural scroll support to weston.ini This adds support for enabling/disabling natural scrolling via a boolean in weston.ini:

Pekka Paalanen ppaalanen at gmail.com
Mon Feb 6 10:00:08 UTC 2017


On Mon, 6 Feb 2017 10:36:56 +1000
Peter Hutterer <peter.hutterer at who-t.net> wrote:

> On Sun, Feb 05, 2017 at 07:30:18PM -0500, Jiayi Zhao wrote:
> > ​​
> > Hmmm, after using udev_device_has_tag(udev_device, "ID_INPUT_TOUCHPAD"),
> > I'm getting linking errors. Quick google of this leads to: libraries on the
> > command line should be after the object files being compiled.
> > Is this a bug?  
> 
> come to think of it, tags are a bit different. you need
> udev_device_get_property_value() instead. and you need to make sure that
> libudev is linked in - that's where your linking errors come from.

Hi,

needing udev API raises further considerations.

A fundamental question is whether udev-using backends should actually
expose udev as part of their API to libweston users (main.c) or whether
it should expose its own abstraction. Since we (I, at least) do not
really have a good understanding what all things one might want, it
might be easier and more flexible to assume that udev will be part of
libweston's DRM backend specific API.

IOW, in compositor-drm.h, the configure_device vfunc should probably
get a new argument referring to the udev thing. This breaks the library
ABI, forcing a libweston major version bump.

Therefore when the DRM-backend is enabled, weston (main.c) should link
to libudev for using it, and the backend-specific API needs to grow
things to support the use of udev. This calls for configure.ac changes.

So far Weston has not been using libudev, which is why you got the
linker errors: it is not linked into Weston, it is only linked to the
specific backends.

Also, it has been possible to build Weston and libweston without
libudev by disabling the backends that depended on it. I'm not sure
supporting that is worthwhile, though, considering DRM is really the
main backend which already depends on libudev.

Looks like libinput is already required by main.c, so following that
example with libudev should be good.


Thanks,
pq

> > On Sun, Feb 5, 2017 at 7:20 PM, Peter Hutterer <peter.hutterer at who-t.net>
> > wrote:
> >   
> > > On Sun, Feb 05, 2017 at 07:13:04PM -0500, Jiayi Zhao wrote:  
> > > > How would ID_INPUT_TOUCHPAD work?
> > > > I have something like udev_device_has_tag(udev_device,  
> > > ID_INPUT_TOUCHPAD)  
> > > > Unfortunately, I'm not sure where this constant is declared and its  
> > > unable  
> > > > to find the tag. :/  
> > >
> > > it's a udev property name, so use it as a string, not a #define.
> > > value is either 1 or 0, so you do need to check for validity.
> > >
> > > Cheers,
> > >    Peter
> > >  
> > > > On Jan 29, 2017 4:42 PM, "Peter Hutterer" <peter.hutterer at who-t.net>  
> > > wrote:  
> > > >  
> > > > > On Fri, Jan 27, 2017 at 09:46:49PM -0500, Jiayi Zhao wrote:  
> > > > > > [libinput]
> > > > > > natural_scroll=true
> > > > > >
> > > > > > CHANGES:
> > > > > >  - libinput_device_config_scroll_has_natural_scroll() is no longer  
> > > > > compared to != 0  
> > > > > >  - added configuration option to weston.ini man page
> > > > > >
> > > > > > Signed-off-by: Jiayi Zhao <jeff.no.zhao at gmail.com>
> > > > > > ---
> > > > > >  compositor/main.c  | 13 +++++++++++++
> > > > > >  man/weston.ini.man |  3 +++
> > > > > >  weston.ini.in      |  1 +
> > > > > >  3 files changed, 17 insertions(+)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170206/fbf55965/attachment.sig>


More information about the wayland-devel mailing list