diff options
author | Timm Bäder <mail@baedert.org> | 2019-02-03 07:04:39 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2019-02-04 17:05:30 +0100 |
commit | 257df1d8b57f6a5e5c38d55b6c8a75d063818f13 (patch) | |
tree | 1047665e82bcbdd778fd9f0876008079525fec2a /gtk/gtktooltip.c | |
parent | 47ba423eca27be751a8fb9a3ad2f73fb483b67e6 (diff) | |
download | gtk+-257df1d8b57f6a5e5c38d55b6c8a75d063818f13.tar.gz |
tooltip: Get the pointer position relative to the toplevel widget
Since we position the tooltip window relative to the toplevel widget and
not actually relative to the effective_toplevel, we shouldn't get the
pointer position relative to the effective_toplevel.
We previously used the pointer position (relative to the
effective_toplevel) and the anchor rect (relative to the toplevel
widget) together to calculate x_distance. This leads to wrong values in
cases where get_surface (new_tooltip_widget) != get_surface (toplevel)
Fixes #1427 in master
Diffstat (limited to 'gtk/gtktooltip.c')
-rw-r--r-- | gtk/gtktooltip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 2b9e6c0a2e..e2bcf29571 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -625,7 +625,7 @@ gtk_tooltip_position (GtkTooltip *tooltip, * If the anchor rectangle isn't to tall, make sure the tooltip isn't too * far away from the pointer position. */ - effective_toplevel = _gtk_widget_get_surface (new_tooltip_widget); + effective_toplevel = _gtk_widget_get_surface (toplevel); gdk_surface_get_device_position (effective_toplevel, device, &pointer_x, &pointer_y, NULL); |