Skip to content

Commit

Permalink
mir: use old scrolling system if we get simple integer values
Browse files Browse the repository at this point in the history
  • Loading branch information
3v1n0 authored and attente committed Feb 5, 2015
1 parent 584cfff commit 38d46aa
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions gdk/mir/gdkmireventsource.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,23 @@ generate_scroll_event (GdkWindow *window, gdouble x, gdouble y, gdouble delta_x,
event->scroll.x = x;
event->scroll.y = y;
event->scroll.state = state;
event->scroll.direction = GDK_SCROLL_SMOOTH;
event->scroll.delta_x = -delta_x;
event->scroll.delta_y = -delta_y;
event->scroll.time = event_time;

if (ABS (delta_x) == 1 && delta_y == 0)
{
event->scroll.direction = (delta_x < 0) ? GDK_SCROLL_LEFT : GDK_SCROLL_RIGHT;
}
else if (ABS (delta_y) == 1 && delta_x == 0)
{
event->scroll.direction = (delta_y < 0) ? GDK_SCROLL_DOWN : GDK_SCROLL_UP;
}
else
{
event->scroll.direction = GDK_SCROLL_SMOOTH;
event->scroll.delta_x = -delta_x;
event->scroll.delta_y = -delta_y;
}

send_event (window, get_pointer (window), event);
}

Expand Down

0 comments on commit 38d46aa

Please sign in to comment.