mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 17:10:40 -05:00
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:
parent
b32c837df9
commit
048f035d30
@ -383,9 +383,13 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|||||||
case CLUTTER_SCROLL_SMOOTH:
|
case CLUTTER_SCROLL_SMOOTH:
|
||||||
{
|
{
|
||||||
double dx, dy;
|
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);
|
clutter_event_get_scroll_delta (event, &dx, &dy);
|
||||||
x_value = wl_fixed_from_double (dx);
|
x_value = wl_fixed_from_double (dx) * factor;
|
||||||
y_value = wl_fixed_from_double (dy);
|
y_value = wl_fixed_from_double (dy) * factor;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user