Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oni 2 doesn't support libinput smooth scroll events #325

Closed
szbergeron opened this issue Jun 6, 2019 · 7 comments
Closed

Oni 2 doesn't support libinput smooth scroll events #325

szbergeron opened this issue Jun 6, 2019 · 7 comments
Labels
A-input Area: Input management, keyboard layout, IME etc. bug Something isn't working enhancement New feature or request U-revery Upstream: Potentially dependent on changes in revery

Comments

@szbergeron
Copy link

This might be a little early to start asking for this, but it seems one of the goals of Oni 2 was to have smoother, more responsive, viewport movement and scrolling. On linux it doesn't currently seem to listen to or support LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS and related discrete events to allow for smooth scrolling on devices using libinput. What work is required to get something along these lines working?

@bryphe
Copy link
Member

bryphe commented Jun 6, 2019

This might be a little early to start asking for this, but it seems one of the goals of Oni 2 was to have smoother, more responsive, viewport movement and scrolling.

Definitely!

On linux it doesn't currently seem to listen to or support LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS and related discrete events to allow for smooth scrolling on devices using libinput.

Good catch... We're using GLFW (backed by X11) for input handling on Linux - which looks like it uses X11 events for processing scroll:

https://github.com/glfw/glfw/blob/51bb76c7c3de934b2dd3affcdc297a32e4817835/src/x11_window.c#L1400

(And they are discrete events, vs something smoother...)

Using libinput sounds like it could help here... We'd basically need Reason hooks to those APIs, to listen to input events - and use them instead of the default scroll events. Not sure if there would be any issues or conflicts the X11 input strategy used by GLFW.

@bryphe bryphe added the bug Something isn't working label Jun 6, 2019
@szbergeron
Copy link
Author

szbergeron commented Jun 6, 2019

As I understand it, Wayland and X11 handle it differently but are both able to provide the same amount of information if XInput2 is used. I'd have to look into it further, but I know this is how GTK is able to provide continuous scroll events on both X11 and Wayland with Libinput and even the older Synaptics driver in a lot of cases.

EDIT: Looks like the GLFW folks already know about this: glfw/glfw#1376
I might look into figuring out a patch for upstream to fix that.

E2: Now I wonder what it does on Wayland, if I can get Oni2 running on a wayland session I'll report back on what happens.

@bryphe
Copy link
Member

bryphe commented Jun 6, 2019

EDIT: Looks like the GLFW folks already know about this: glfw/glfw#1376

Nice find @szbergeron ! Good catch - seems like a bug that GLFW doesn't use the latest smooth scrolling APIs.

E2: Now I wonder what it does on Wayland, if I can get Oni2 running on a wayland session I'll report back on what happens.

Unfortunately there is a blocking bug for this at the moment - our build of GLFW isn't set up to build wayland (today): https://github.com/bryphe/reason-glfw/issues/69

@szbergeron
Copy link
Author

For GLFW not having a build support both X and Wayland is definitely not awesome, I'll see if I can peek around their source code and start making some patches. I'm not super familiar with the intricacies of Xinput2 but I can try my hand at it.

@bryphe
Copy link
Member

bryphe commented Jun 8, 2019

Ya, it's a bummer that it needs separates builds for X / Wayland.

I'll see if I can peek around their source code and start making some patches. I'm not super familiar with the intricacies of Xinput2 but I can try my hand at it.

That would be awesome - thanks for the help!

@szbergeron
Copy link
Author

Update from discussion on discord:

I'm looking into handling all input with Revery rather than pulling from GLFW, just because of the flexibility that would provide in how input gets handled, and should make this "just work" based on changes in Revery.

@CrossR CrossR added the enhancement New feature or request label Jun 22, 2019
@glennsl glennsl added A-input Area: Input management, keyboard layout, IME etc. U-revery Upstream: Potentially dependent on changes in revery labels Nov 18, 2019
@szbergeron
Copy link
Author

This is entirely downstream at this point (revery, sdl2, libscroll) so probably doesn't need to be tracked here anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-input Area: Input management, keyboard layout, IME etc. bug Something isn't working enhancement New feature or request U-revery Upstream: Potentially dependent on changes in revery
Projects
None yet
Development

No branches or pull requests

4 participants