[libwnck] Pager: add suport for GDK_SCROLL_SMOOTH



commit 82f4f0985d7ddb41bd3f4ddd1398ce37a88308f9
Author: Marco Trevisan (TreviÃo) <mail 3v1n0 net>
Date:   Tue Feb 5 21:30:23 2013 +0100

    Pager: add suport for GDK_SCROLL_SMOOTH

 libwnck/pager.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/libwnck/pager.c b/libwnck/pager.c
index 7ef6401..f578938 100644
--- a/libwnck/pager.c
+++ b/libwnck/pager.c
@@ -2093,6 +2093,8 @@ wnck_pager_scroll_event (GtkWidget      *widget,
   int                 n_workspaces;
   int                 n_columns;
   int                 in_last_row;
+  gdouble             smooth_x;
+  gdouble             smooth_y;
 
   pager = WNCK_PAGER (widget);
 
@@ -2125,6 +2127,13 @@ wnck_pager_scroll_event (GtkWidget      *widget,
           case GDK_SCROLL_LEFT:
             absolute_direction = GDK_SCROLL_RIGHT;
             break;
+          case GDK_SCROLL_SMOOTH:
+            gdk_event_get_scroll_deltas ((GdkEvent*)event, &smooth_x, &smooth_y);
+            if (smooth_x > 5)
+              absolute_direction = GDK_SCROLL_RIGHT;
+            else if (smooth_x < -5)
+              absolute_direction = GDK_SCROLL_LEFT;
+            break;
         }
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]