summaryrefslogtreecommitdiff
path: root/gtk/gtktooltip.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@imendio.com>2007-07-19 15:03:18 +0000
committerKristian Rietveld <kristian@src.gnome.org>2007-07-19 15:03:18 +0000
commit9719e5fb3cfe9b025e238ec4ad04d940a98dbc90 (patch)
tree0c1b2b609aab3b797e1130aa72beee9a10c0e3cf /gtk/gtktooltip.c
parent7b2e82f5d01f470606c1404ba5fa41e24d42e26d (diff)
downloadgtk+-9719e5fb3cfe9b025e238ec4ad04d940a98dbc90.tar.gz
handle no-window and regular widgets seperately.
2007-07-19 Kristian Rietveld <kris@imendio.com> * gtk/gtktooltip.c (find_topmost_widget_coords_from_event): handle no-window and regular widgets seperately. * gtk/gtktreeview.c (gkt_tree_view_set_tooltip_cell): rect.x should be zero. svn path=/trunk/; revision=18502
Diffstat (limited to 'gtk/gtktooltip.c')
-rw-r--r--gtk/gtktooltip.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index c6062053ae..a79617034c 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -593,12 +593,25 @@ 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 (!tmp ||
- tx < 0 || tx >= tmp->allocation.width ||
- ty < 0 || ty >= tmp->allocation.height)
+ if (!tmp)
return NULL;
+ /* Make sure the pointer can actually be on the widget returned */
+ if (GTK_WIDGET_NO_WINDOW (tmp))
+ {
+ if (tx < tmp->allocation.x ||
+ tx >= tmp->allocation.x + tmp->allocation.width ||
+ ty < tmp->allocation.y ||
+ ty >= tmp->allocation.y + tmp->allocation.height)
+ return NULL;
+ }
+ else
+ {
+ if (tx < 0 || tx >= tmp->allocation.width ||
+ ty < 0 || ty >= tmp->allocation.height)
+ return NULL;
+ }
+
if (x)
*x = tx;
if (y)