r4318 - in trunk/src/target/OM-2007.2/libraries/libmokoui2: . libmokoui

chris at sita.openmoko.org chris at sita.openmoko.org
Mon Apr 7 11:55:14 CEST 2008


Author: chris
Date: 2008-04-07 11:55:13 +0200 (Mon, 07 Apr 2008)
New Revision: 4318

Modified:
   trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog
   trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-finger-scroll.c
Log:
        * libmokoui/moko-finger-scroll.c
        (moko_finger_scroll_button_press_cb),
        (moko_finger_scroll_motion_notify_cb),
        (moko_finger_scroll_button_release_cb):
        Don't bother checking the last event type when detecting infinite
        loops, it just causes problems with double-clicking


Modified: trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog	2008-04-07 09:25:58 UTC (rev 4317)
+++ trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog	2008-04-07 09:55:13 UTC (rev 4318)
@@ -1,3 +1,12 @@
+2008-04-07  Chris Lord  <chris at openedhand.com>
+
+	* libmokoui/moko-finger-scroll.c
+	(moko_finger_scroll_button_press_cb),
+	(moko_finger_scroll_motion_notify_cb),
+	(moko_finger_scroll_button_release_cb):
+	Don't bother checking the last event type when detecting infinite
+	loops, it just causes problems with double-clicking
+
 2008-01-29  Chris Lord  <chris at openedhand.com>
 
 	* bindings/python/Makefile.am:

Modified: trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-finger-scroll.c
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-finger-scroll.c	2008-04-07 09:25:58 UTC (rev 4317)
+++ trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-finger-scroll.c	2008-04-07 09:55:13 UTC (rev 4318)
@@ -52,8 +52,7 @@
 	gdouble ey;	/* motion event in acceleration mode */
 	gboolean enabled;
 	gboolean clicked;
-	GdkEventType last_type;	/* Last event type and time, to stop */
-	guint32 last_time;	/* infinite loops */
+	guint32 last_time;	/* Last event time, to stop infinite loops */
 	gboolean moved;
 	GTimeVal click_start;
 	GTimeVal last_click;
@@ -232,8 +231,9 @@
 	MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (scroll);
 
 	if ((!priv->enabled) || (event->button != 1) ||
-	    ((event->time == priv->last_time) &&
-	     (event->type == priv->last_type))) return TRUE;
+	    ((event->time == priv->last_time))) return TRUE;
+	
+	priv->last_time = event->time;
 
 	priv->click_x = event->x;
 	priv->click_y = event->y;
@@ -245,8 +245,6 @@
 	}
 	
 	g_get_current_time (&priv->click_start);
-	priv->last_type = event->type;
-	priv->last_time = event->time;
 	priv->x = event->x;
 	priv->y = event->y;
 	priv->ix = priv->x;
@@ -470,8 +468,7 @@
 	gdouble x, y;
 
 	if ((!priv->enabled) || (!priv->clicked) ||
-	    ((event->time == priv->last_time) &&
-	     (event->type == priv->last_type))) {
+	    ((event->time == priv->last_time))) {
 		gdk_window_get_pointer (
 			GTK_WIDGET (scroll)->window, NULL, NULL, 0);
 		return TRUE;
@@ -535,7 +532,6 @@
 	
 	if (priv->child) {
 		/* Send motion notify to child */
-		priv->last_type = event->type;
 		priv->last_time = event->time;
 		event = (GdkEventMotion *)gdk_event_copy ((GdkEvent *)event);
 		event->x = priv->cx + (event->x - priv->ix);
@@ -562,13 +558,11 @@
 	gdouble delta, speed_x, speed_y;
 	
 	if ((!priv->clicked) || (!priv->enabled) || (event->button != 1) ||
-	    ((event->time == priv->last_time) &&
-	     (event->type == priv->last_type)))
+	    ((event->time == priv->last_time)))
 		return TRUE;
 
-	priv->last_type = event->type;
-	
 	priv->last_time = event->time;
+	
 	g_get_current_time (&current);
 
 	priv->clicked = FALSE;





More information about the commitlog mailing list