Index: gtkwidget.c
===================================================================
--- gtkwidget.c	(revision 17590)
+++ gtkwidget.c	(working copy)
@@ -1514,9 +1546,9 @@ gtk_widget_class_init (GtkWidgetClass *k
    * GtkWidget::query-tooltip:
    * @widget: the object which received the signal
    * @x: the x coordinate of the cursor position where the request has been
-   *     emitted, relative to the widget's allocation
+   *     emitted, relative to widget->window
    * @y: the y coordinate of the cursor position where the request has been
-   *     emitted, relative to the widget's allocation
+   *     emitted, relative to widget->window
    * @keyboard_mode: %TRUE if the tooltip was trigged using the keyboard
    * @tooltip: a #GtkTooltip
    *
Index: gtktooltip.c
===================================================================
--- gtktooltip.c	(revision 17628)
+++ gtktooltip.c	(working copy)
@@ -463,6 +480,27 @@ find_widget_under_pointer (GdkWindow *wi
   child_loc.y = *y;
 
   gdk_window_get_user_data (window, (void **)&event_widget);
+
+  while (window && window != event_widget->window)
+    {
+      gint px, py;
+
+      gdk_window_get_position (window, &px, &py);
+      child_loc.x += px;
+      child_loc.y += py;
+
+      window = gdk_window_get_parent (window);
+    }
+
+  if (GTK_WIDGET_NO_WINDOW (event_widget))
+    {
+      child_loc.x += event_widget->allocation.x;
+      child_loc.y += event_widget->allocation.y;
+    }
+
+  if (!window)
+    return NULL;
+
   if (GTK_IS_CONTAINER (event_widget))
     {
       window_to_alloc (event_widget,
