You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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.
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.
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).
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. 😅
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.
Activity
Ralith commentedon Jul 17, 2017
Discussion in #218 may be of interest.
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.
jwilm commentedon Jul 17, 2017
It's possible the X11 backend was still being used under @alexheretic's testing.
alexheretic commentedon Jul 17, 2017
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.Ralith commentedon Jul 17, 2017
Maybe @vberger has some insight into what's going on there?
alexheretic commentedon Jul 17, 2017
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).
elinorbgr commentedon Jul 17, 2017
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.
Ralith commentedon Jul 18, 2017
MouseScrollDelta::LineDeltasays:So, horizontal scrolling should be fine.
Merge next back to dev branch (rust-windowing#305)