diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2016-05-03 10:44:16 +0200 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2016-05-03 10:50:50 +0200 |
commit | a537bdc1fe4d4323b9a0c39b23cb15633eeff64c (patch) | |
tree | 505e27e6298b36d1a5f1b77e9be6d7366e5db42f /gdk | |
parent | 848dd947ca8629e846def2cc03affe3f25db7388 (diff) | |
download | gtk+-a537bdc1fe4d4323b9a0c39b23cb15633eeff64c.tar.gz |
wayland: fix up/down mix up in discrete events
The wayland specification for discrete step information for scroll and
other axes reads:
| The discrete value carries the directional information. e.g. a
| value of -2 is two steps towards the negative direction of this axis.
mutter sets a value of 1 for SCROLL_DOWN events and -1 for SCROLL_UP
events.
gdkdevice Wayland backend does the opposite, it translates a positive
discrete value as SCROLL_UP and a negative value as SCROLL_DOWN, which
ends up inverting the scrolling direction.
Fix the logic in gdkdevice Wayland to use a positive value as
SCROLL_DOWN and a negative value as SCROLL_UP so that it matches mutter
and weston logic.
https://bugzilla.gnome.org/show_bug.cgi?id=765907
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/wayland/gdkdevice-wayland.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index efaed86e6c..3d3b4d62b6 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -1049,9 +1049,9 @@ flush_scroll_event (GdkWaylandSeat *seat, else if (pointer_frame->discrete_x < 0) direction = GDK_SCROLL_RIGHT; else if (pointer_frame->discrete_y > 0) - direction = GDK_SCROLL_UP; - else direction = GDK_SCROLL_DOWN; + else + direction = GDK_SCROLL_UP; flush_discrete_scroll_event (seat, direction); pointer_frame->discrete_x = 0; |