]> Pileus Git - ~andy/gtk/commitdiff
check if the pointer is really over the returned widget, since the
authorKristian Rietveld <kris@imendio.com>
Mon, 16 Jul 2007 16:39:53 +0000 (16:39 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Mon, 16 Jul 2007 16:39:53 +0000 (16:39 +0000)
2007-07-16  Kristian Rietveld  <kris@imendio.com>

* gtk/gtktooltip.c (find_topmost_widget_coords_from_event): check
if the pointer is really over the returned widget, since the
coordinate check may not always be hit in find_widget_under_pointer().

svn path=/trunk/; revision=18478

ChangeLog
gtk/gtktooltip.c

index 2001ec6f9e9f7a9542e4dabb7ab67f2e5344df50..7a2e12b058696b7368bfe04ce739322af9218cd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-07-16  Kristian Rietveld  <kris@imendio.com>
+
+       * gtk/gtktooltip.c (find_topmost_widget_coords_from_event): check
+       if the pointer is really over the returned widget, since the
+       coordinate check may not always be hit in find_widget_under_pointer().
+
 2007-07-16  Matthias Clasen <mclasen@redhat.com>
 
        * gtk/gtkfilechooserbutton.c (model_add_special_get_info_cb):
index f7fe733bf33da28d7426dc5cd13e0c18c073513f..68ad4ceee8a76530fd19b82a5cc1f53483a4e204 100644 (file)
@@ -593,6 +593,11 @@ find_topmost_widget_coords_from_event (GdkEvent *event,
 
   tmp = find_widget_under_pointer (event->any.window, &tx, &ty);
 
+  /* Make sure the pointer can actually be on the widget returned */
+  if (tx < 0 || tx >= tmp->allocation.width ||
+      ty < 0 || ty >= tmp->allocation.height)
+    return NULL;
+
   if (x)
     *x = tx;
   if (y)