wayland: Scale smooth scroll events to pointer motion coordinate space

Smooth scroll event vectors from clutter have the same dimensions as the
ones from from Xi2, i.e. where 1.0 is 1 discrete scroll step. To scale
these to the coordinate space used by wl_pointer.axis
vertical/horizontal scroll events, multiply the vector by 10.

https://bugzilla.gnome.org/show_bug.cgi?id=729601
This commit is contained in:
Jonas Ådahl 2014-05-03 21:06:08 +02:00
parent b32c837df9
commit 048f035d30

View File

@ -383,9 +383,13 @@ handle_scroll_event (MetaWaylandPointer *pointer,
case CLUTTER_SCROLL_SMOOTH:
{
double dx, dy;
/* Clutter smooth scroll events are in discrete steps (1 step = 1.0 long
* vector along one axis). To convert to smooth scroll events that are
* in pointer motion event space, multiply the vector with the 10. */
const double factor = 10.0;
clutter_event_get_scroll_delta (event, &dx, &dy);
x_value = wl_fixed_from_double (dx);
y_value = wl_fixed_from_double (dy);
x_value = wl_fixed_from_double (dx) * factor;
y_value = wl_fixed_from_double (dy) * factor;
}
break;