[gtk+/wip/mir2] mir: use old scrolling system if we get simple integer values
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/mir2] mir: use old scrolling system if we get simple integer values
- Date: Fri, 12 Dec 2014 00:41:25 +0000 (UTC)
commit 84119c20f297e4d02f4667a3d4d921e785fd77e9
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Fri Dec 12 01:40:55 2014 +0100
mir: use old scrolling system if we get simple integer values
gdk/mir/gdkmireventsource.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/gdk/mir/gdkmireventsource.c b/gdk/mir/gdkmireventsource.c
index caa07b1..8a16528 100644
--- a/gdk/mir/gdkmireventsource.c
+++ b/gdk/mir/gdkmireventsource.c
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]