From 4995ea0fcb3e25b3b609a6548754b6a5a8c1caef Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 4 Feb 2009 01:16:35 +0000 Subject: [PATCH] Set the root coordinates in the event correctly. Patch by Kristian * 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 | 8 ++++++++ gtk/gtktooltip.c | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8f1b02a5d..f0b58229f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-02-03 Matthias Clasen + + 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 * configure.in: Bump version diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 06daaa08e..af733b7a6 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -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. */