[gtk+/client-side-windows: 144/284] Clean up the scroll support a little



commit da8666d7458a6f2a1bee8bcdb652bb354eb3e110
Author: Richard Hult <richard imendio com>
Date:   Fri Jan 16 19:47:16 2009 +0100

    Clean up the scroll support a little
---
 gdk/quartz/gdkevents-quartz.c |   38 ++++++++++++++++----------------------
 1 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index bbd1e7d..1a66a31 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -1807,31 +1807,25 @@ gdk_event_translate (GdkEvent *event,
 	float dy = [nsevent deltaY];
 	GdkScrollDirection direction;
 
-	/* The delta is how much the mouse wheel has moved. Since there's no such thing in GTK+
-	 * we accomodate by sending a different number of scroll wheel events.
-	 */
-
-	/* First do y events */
-	if (dy < 0.0)
-	  {
-	    dy = -dy;
-	    direction = GDK_SCROLL_DOWN;
-	  }
-	else
-	  direction = GDK_SCROLL_UP;
+        if (dy != 0)
+          {
+            if (dy < 0.0)
+              direction = GDK_SCROLL_DOWN;
+            else
+              direction = GDK_SCROLL_UP;
 
-        fill_scroll_event (window, event, nsevent, direction);
+            fill_scroll_event (window, event, nsevent, x, y, direction);
+          }
 
-	/* Now do x events */
-	if (dx < 0.0)
-	  {
-	    dx = -dx;
-	    direction = GDK_SCROLL_RIGHT;
-	  }
-	else
-	  direction = GDK_SCROLL_LEFT;
+        if (dx != 0)
+          {
+            if (dx < 0.0)
+              direction = GDK_SCROLL_RIGHT;
+            else
+              direction = GDK_SCROLL_LEFT;
 
-        fill_scroll_event (window, event, nsevent, direction);
+            fill_scroll_event (window, event, nsevent, x, y, direction);
+          }
       }
       break;
 



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