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

chris at sita.openmoko.org chris at sita.openmoko.org
Mon Oct 15 17:03:58 CEST 2007


Author: chris
Date: 2007-10-15 17:03:50 +0200 (Mon, 15 Oct 2007)
New Revision: 3177

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 alter event struct, fixes weird event flooding bug


Modified: trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog	2007-10-15 14:22:30 UTC (rev 3176)
+++ trunk/src/target/OM-2007.2/libraries/libmokoui2/ChangeLog	2007-10-15 15:03:50 UTC (rev 3177)
@@ -1,3 +1,11 @@
+2007-10-15  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 alter event struct, fixes weird event flooding bug
+
 2007-10-12  Chris Lord  <chris at openedhand.com>
 
 	* libmokoui/moko-finger-scroll.c:

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	2007-10-15 14:22:30 UTC (rev 3176)
+++ trunk/src/target/OM-2007.2/libraries/libmokoui2/libmokoui/moko-finger-scroll.c	2007-10-15 15:03:50 UTC (rev 3177)
@@ -241,6 +241,7 @@
 		g_object_add_weak_pointer ((GObject *)priv->child,
 			&priv->child);
 		
+		event = (GdkEventButton *)gdk_event_copy ((GdkEvent *)event);
 		event->x = x;
 		event->y = y;
 		priv->cx = x;
@@ -252,6 +253,7 @@
 		/* Send synthetic click (button press/release) event */
 		((GdkEventAny *)event)->window = g_object_ref (priv->child);
 		gdk_event_put ((GdkEvent *)event);
+		gdk_event_free ((GdkEvent *)event);
 	} else
 		priv->child = NULL;
 
@@ -472,10 +474,12 @@
 		/* 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);
 		event->y = priv->cy + (event->y - priv->iy);
 		event->window = g_object_ref (priv->child);
 		gdk_event_put ((GdkEvent *)event);
+		gdk_event_free ((GdkEvent *)event);
 	}
 
 	gdk_window_get_pointer (GTK_WIDGET (scroll)->window, NULL, NULL, 0);
@@ -508,14 +512,15 @@
 		GTK_BIN (priv->align)->child->window,
 		event->x, event->y, &x, &y);
 
-	event->x = x;
-	event->y = y;
-
 	if (!priv->child) {
 		priv->moved = FALSE;
 		return TRUE;
 	}
 	
+	event = (GdkEventButton *)gdk_event_copy ((GdkEvent *)event);
+	event->x = x;
+	event->y = y;
+
 	/* Leave the widget if we've moved - This doesn't break selection,
 	 * but stops buttons from being clicked.
 	 */
@@ -538,6 +543,7 @@
 		&priv->child);
 
 	priv->moved = FALSE;
+	gdk_event_free ((GdkEvent *)event);
 	
 	return TRUE;
 }





More information about the commitlog mailing list