[evolution/gnome-3-0] Bug 652629 - GnomeCanvas: Disregard synthesized crossing events



commit ace1b2c6fea5c671a00f31be554d1d3f3b0a47d3
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Jul 10 12:18:15 2011 -0400

    Bug 652629 - GnomeCanvas: Disregard synthesized crossing events
    
    synth_crossing() in gtkwidget.c does not set valid pointer coordinates,
    but GnomeCanvas relies on these coordinates to figure out what canvas
    item the event applies to.
    
    Detect these synthesized GDK_ENTER_NOTIFY and GDK_LEAVE_NOTIFY events
    and disregard them.
    
    This was breaking drag-and-drop of EMinicards and probably elsewhere.
    
    (cherry picked from commit 830102ae9fef49bf5f97bae503b069d7731be712)

 libgnomecanvas/gnome-canvas.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index 8be48a9..dd1545b 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -2723,6 +2723,13 @@ gnome_canvas_crossing (GtkWidget *widget, GdkEventCrossing *event)
 	if (event->window != bin_window)
 		return FALSE;
 
+	/* XXX Detect and disregard synthesized crossing events generated
+	 *     by synth_crossing() in gtkwidget.c.  The pointer coordinates
+	 *     are invalid and pick_current_item() relies on them. */
+	if (event->x == 0 && event->y == 0 &&
+	    event->x_root == 0 && event->y_root == 0)
+		return FALSE;
+
 	canvas->state = event->state;
 	return pick_current_item (canvas, (GdkEvent *) event);
 }



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