[PATCH] [weston, v2] weston.ini: Add natural scroll support to weston.ini

Jiayi Zhao jeff.no.zhao at gmail.com
Sat Jan 28 01:53:11 UTC 2017


Hey,

okay, I'll make a new patch with updated weston.ini manual soon.

Cheers,
Jiayi

On Jan 27, 2017 6:59 AM, "Pekka Paalanen" <ppaalanen at gmail.com> wrote:

> On Sat, 22 Oct 2016 13:31:28 -0400
> Jiayi Zhao <jeff.no.zhao at gmail.com> wrote:
>
> > This adds support for enabling/disabling natural scrolling
> > via a boolean in weston.ini:
> >
> > [libinput]
> > natural_scroll=true
> >
> > CHANGES:
> >  - libinput_device_config_scroll_has_natural_scroll() is not longer
> compared to != 0
> >
> > Signed-off-by: Jiayi Zhao <jeff.no.zhao at gmail.com>
> > ---
> >  compositor/main.c | 13 +++++++++++++
> >  weston.ini.in     |  1 +
> >  2 files changed, 14 insertions(+)
> >
> > diff --git a/compositor/main.c b/compositor/main.c
> > index 080aa61..abfb55b 100644
> > --- a/compositor/main.c
> > +++ b/compositor/main.c
> > @@ -1095,6 +1095,8 @@ configure_input_device(struct weston_compositor
> *compositor,
> >       struct weston_config *config = wet_get_config(compositor);
> >       int enable_tap;
> >       int enable_tap_default;
> > +     int natural_scroll;
> > +     int natural_scroll_default;
> >
> >       s = weston_config_get_section(config,
> >                                     "libinput", NULL, NULL);
> > @@ -1109,6 +1111,17 @@ configure_input_device(struct weston_compositor
> *compositor,
> >               libinput_device_config_tap_set_enabled(device,
> >                                                      enable_tap);
> >       }
> > +
> > +     if (libinput_device_config_scroll_has_natural_scroll(device)) {
> > +             natural_scroll_default =
> > +                     libinput_device_config_scroll_
> get_default_natural_scroll_enabled(
> > +                             device);
> > +             weston_config_section_get_bool(s, "natural_scroll",
> > +                                            &natural_scroll,
> > +                                            natural_scroll_default);
> > +             libinput_device_config_scroll_set_natural_scroll_enabled(
> device,
> > +                                                    natural_scroll);
> > +     }
> >  }
> >
> >  static void
> > diff --git a/weston.ini.in b/weston.ini.in
> > index d837fb5..c7b8b98 100644
> > --- a/weston.ini.in
> > +++ b/weston.ini.in
> > @@ -60,6 +60,7 @@ path=@libexecdir@/weston-keyboard
> >
> >  #[libinput]
> >  #enable_tap=true
> > +#natural_scroll=false
> >
> >  #[touchpad]
> >  #constant_accel_factor = 50
>
> Hi,
>
> I suppose this is ok, but it should also update the manual page for
> weston.ini to mention this option.
>
>
> Thanks,
> pq
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170127/76084365/attachment-0001.html>


More information about the wayland-devel mailing list