On Wed, 30 Jan 2019 09:47:39 +1000 Peter Hutterer <peter.hutte...@who-t.net> wrote:
> On Tue, Jan 29, 2019 at 03:36:41PM +0200, Pekka Paalanen wrote: > > On Tue, 29 Jan 2019 16:57:34 +1000 > > Peter Hutterer <peter.hutte...@who-t.net> wrote: > > > > > The new API returns scroll wheels as fractions of 120. > > > > > > Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> > > > --- > > > Turns out it's not the most complicated patch... > > > > > > This is an RFC only because libinput hasn't been released yet, and it's > > > waiting on the kernel release anyway. Given the expected delay, I hope > > > autotools is removed by the time this becomes a mergeable. > > > > > > libweston/libinput-device.c | 6 ++++++ > > > meson.build | 9 +++++++++ > > > 2 files changed, 15 insertions(+) > > > > > > diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c > > > index e25df144..e028d246 100644 > > > --- a/libweston/libinput-device.c > > > +++ b/libweston/libinput-device.c > > > @@ -190,9 +190,15 @@ normalize_scroll(struct libinput_event_pointer > > > *pointer_event, > > > */ > > > switch (source) { > > > case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL: > > > +#if HAVE_LIBINPUT_AXIS_V120 > > > + value = 10 * libinput_event_pointer_get_axis_value_v120( > > > + > > > pointer_event, > > > + axis)/120.0; > > > > > > > Hi Peter, > > > > spaces needed around the operator. > > thx, and I will submit a MR proper anyway, this was just a FYI patch to > illustrate the world probably won't end if we add hi-res scrolling. > > > > +#else > > > value = 10 * libinput_event_pointer_get_axis_value_discrete( > > > > > > pointer_event, > > > axis); > > > +#endif > > > break; > > > case LIBINPUT_POINTER_AXIS_SOURCE_FINGER: > > > case LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS: > > > diff --git a/meson.build b/meson.build > > > index 7826dbb0..dfb10ce5 100644 > > > --- a/meson.build > > > +++ b/meson.build > > > @@ -143,6 +143,15 @@ dep_wayland_server = dependency('wayland-server', > > > version: '>= 1.12.0') > > > dep_wayland_client = dependency('wayland-client', version: '>= 1.12.0') > > > dep_pixman = dependency('pixman-1', version: '>= 0.25.2') > > > dep_libinput = dependency('libinput', version: '>= 0.8.0') > > > +have_libinput_axis_v120_code = ''' > > > +#include <libinput.h> > > > +int main(void) { libinput_event_pointer_get_axis_value_v120(NULL, 0); } > > > +''' > > > +have_libinput_axis_v120 = cc.links(have_libinput_axis_v120_code, > > > + name: > > > 'libinput_event_pointer_get_axis_value_v120', > > > + dependencies: dep_libinput) > > > > I guess the above gets replaced with a version check after libinput is > > released? > > I found the direct function check works just as well and has the benefit of > working with pre-releases (or patched versions) where needed. Esp. because > here we just look for a single API call here. Do you have a preference? Hi Peter, maybe simply hard-require the new libinput release and don't even bother with the #define below? But I suppose that could be inconvenient for some. Since it's just one function, I suppose I don't mind that much. The version check would be much simpler in meson though. Oh, you should probably use cc.has_function() instead of that hand-written thing, that would help. Thanks, pq > > > +config_h.set10('HAVE_LIBINPUT_AXIS_V120', have_libinput_axis_v120) > > > +
pgpvE2cevx0Qe.pgp
Description: OpenPGP digital signature
_______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel