]> Pileus Git - ~andy/gtk/commitdiff
Set the root coordinates in the event correctly. Patch by Kristian
authorMatthias Clasen <matthiasc@src.gnome.org>
Wed, 4 Feb 2009 01:16:35 +0000 (01:16 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 4 Feb 2009 01:16:35 +0000 (01:16 +0000)
        * gtk/gtktooltip.c (gtk_tooltip_trigger_query): Set the root
        coordinates in the event correctly. Patch by Kristian Rietveld.

svn path=/trunk/; revision=22277

ChangeLog
gtk/gtktooltip.c

index 8f1b02a5dba7c2c9c55460773c10c55ccd83e201..f0b58229ff8c06c963d015485e970a362d552047 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-02-03  Matthias Clasen  <mclasen@redhat.com>
+
+       Bug 538439 – tooltip may appear in upper left corner instead of 
+       over widget
+
+       * gtk/gtktooltip.c (gtk_tooltip_trigger_query): Set the root 
+       coordinates in the event correctly. Patch by Kristian Rietveld.
+
 2009-02-02  Matthias Clasen  <mclasen@redhat.com>
 
        * configure.in: Bump version
index 06daaa08e8e31c2847647be195a6173792ebef48..af733b7a65e460bb0924c415059960f7229f2497 100644 (file)
@@ -440,6 +440,10 @@ gtk_tooltip_trigger_tooltip_query (GdkDisplay *display)
   event.motion.y = y;
   event.motion.is_hint = FALSE;
 
+  gdk_window_get_origin (window, &x, &y);
+  event.motion.x_root = event.motion.x + x;
+  event.motion.y_root = event.motion.y + y;
+
   _gtk_tooltip_handle_event (&event);
 }
 
@@ -518,6 +522,9 @@ child_location_foreach (GtkWidget *child,
   if (!GTK_WIDGET_DRAWABLE (child))
     return;
 
+  x = 0;
+  y = 0;
+
   /* (child_loc->x, child_loc->y) are relative to
    * child_loc->container's allocation.
    */