seat: Add support for smooth scrolling

This commit is contained in:
Jasper St. Pierre 2014-03-10 11:10:36 -04:00
parent 254e2e993c
commit d6b6b363ad

View File

@ -283,6 +283,9 @@ handle_scroll_event (MetaWaylandSeat *seat,
if (!seat->pointer.focus_resource) if (!seat->pointer.focus_resource)
return; return;
if (clutter_event_is_pointer_emulated (event))
return;
switch (clutter_event_get_scroll_direction (event)) switch (clutter_event_get_scroll_direction (event))
{ {
case CLUTTER_SCROLL_UP: case CLUTTER_SCROLL_UP:
@ -301,6 +304,15 @@ handle_scroll_event (MetaWaylandSeat *seat,
x_value = DEFAULT_AXIS_STEP_DISTANCE; x_value = DEFAULT_AXIS_STEP_DISTANCE;
break; break;
case CLUTTER_SCROLL_SMOOTH:
{
double dx, dy;
clutter_event_get_scroll_delta (event, &dx, &dy);
x_value = wl_fixed_from_double (dx);
y_value = wl_fixed_from_double (dy);
}
break;
default: default:
return; return;
} }