Skip to content

Linux: Inversed MouseScrollDelta::LineDelta values #233

Closed

Description

@alexheretic

Since updating winit 0.6 -> 0.7 I've noticed the MouseScrollDelta::LineDelta(_, y) y values have inverted on Linux x11 & wayland. So now the behaviour is opposite of the documentation. The previous/correct behaviour is 1 scrolling away from yourself, -1 scrolling back.

Testing the same case on windows, and the y value was correct as documented. I didn't test on mac, but I'm presuming it's a Linux regression. Can anyone else confirm this on their setup?

Activity

  1. added
    DS - wayland
    DS - x11
    on Jul 17, 2017
  2. Ralith commented on Jul 17, 2017

    @Ralith
    Contributor

    Discussion in #218 may be of interest.

    The previous/correct behaviour is 1 scrolling away from yourself, -1 scrolling back.

    Reviewing the documentation on the enum, it looks like I just got this wrong when I rewrote the X11 backend. Which makes it confusing that you observe the same behavior in Wayland, which afaik did not undergo major changes in that period.

  3. jwilm commented on Jul 17, 2017

    @jwilm
    Contributor

    Which makes it confusing that you observe the same behavior in Wayland, which afaik did not undergo major changes in that period.

    It's possible the X11 backend was still being used under @alexheretic's testing.

  4. alexheretic commented on Jul 17, 2017

    @alexheretic
    ContributorAuthor

    I can confirm the incorrect behaviour in both x11 & wayland backends. Running a wayland session, as I do, the unix backend can be chosen using WINIT_UNIX_BACKEND. Also worth noting that currently the two backend's appearance cannot be mistaken; wayland is half transparent and has minimal window decoration.

  5. Ralith commented on Jul 17, 2017

    @Ralith
    Contributor

    Maybe @vberger has some insight into what's going on there?

  6. alexheretic commented on Jul 17, 2017

    @alexheretic
    ContributorAuthor

    To be totally accurate, I know this worked in 0.6 in x11. And now I can test it not working in both x & wayland.
    It is possible it may not have been correct in wayland before. (My older code doesn't work at all with a 0.6 wayland backend, so I can't test).

  7. elinorbgr commented on Jul 17, 2017

    @elinorbgr
    Contributor

    Currently the wayland backend simply aggregates and forwards scrolling values it got from the compositor. Apparently, the convention for wayland on this is the opposite of the one chosen in winit. This is entirely possible that this was wrong from the start. 😅

    It should be as simple a fix as flipping the signs here : https://github.com/tomaka/winit/blob/master/src/platform/linux/wayland/event_loop.rs#L458-L459

    However, this raises the question of horizontal scrolling, are the convention mixed here as well? It looks like the convention on wayland is that the signs of the scroll delta are positive when going down or right, thus matching the conventions of the mouse deltas when moving the pointer.

  8. Ralith commented on Jul 18, 2017

    @Ralith
    Contributor

    MouseScrollDelta::LineDelta says:

    Positive values indicate movement forward (away from the user) or rightwards.

    So, horizontal scrolling should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DS - waylandDS - x11

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions