Skip to content

Commit

Permalink
Wayland: Fix scroll offsets being inverted
Browse files Browse the repository at this point in the history
Scrolling offsets were inverted compared to X11 and Win32.

Fixes #1463.

(cherry picked from commit f760b12)
  • Loading branch information
elmindreda committed Jul 16, 2020
1 parent bd2fb9e commit 1147042
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ information on what to include when reporting a bug.
reported (#1112,#1415,#1472,#1616)
- [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704)
- [Wayland] Bugfix: Retrieving partial framebuffer size would segfault
- [Wayland] Bugfix: Scrolling offsets were inverted compared to other platforms
(#1463)


## Contact
Expand Down Expand Up @@ -274,6 +276,7 @@ skills.
- ndogxj
- Kristian Nielsen
- Kamil Nowakowski
- onox
- Denis Ovod
- Ozzy
- Andri Pálsson
Expand Down
4 changes: 2 additions & 2 deletions src/wl_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ static void pointerHandleAxis(void* data,
axis == WL_POINTER_AXIS_VERTICAL_SCROLL);

if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL)
x = wl_fixed_to_double(value) * scrollFactor;
x = -wl_fixed_to_double(value) * scrollFactor;
else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL)
y = wl_fixed_to_double(value) * scrollFactor;
y = -wl_fixed_to_double(value) * scrollFactor;

_glfwInputScroll(window, x, y);
}
Expand Down

0 comments on commit 1147042

Please sign in to comment.