summaryrefslogtreecommitdiff
path: root/gtk/gtkentry.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2017-08-03 11:14:53 +0200
committerTimm Bäder <mail@baedert.org>2017-08-03 11:14:53 +0200
commit5cafa2b1ce1ee38c8f3bb1befeed98ae55dcc923 (patch)
tree1f3bc7cdb815cd47c7dc8fc100bf70b2ab59ab62 /gtk/gtkentry.c
parent765aff3f0e9bdba63057dd5926a79d2202291229 (diff)
downloadgtk+-5cafa2b1ce1ee38c8f3bb1befeed98ae55dcc923.tar.gz
entry: get_icon_area returns in entry coordinates
This fixes the popover positions in the gtk4-demo/popovers, and it also just makes sense. Also document what the returned coordinates are relatiev to.
Diffstat (limited to 'gtk/gtkentry.c')
-rw-r--r--gtk/gtkentry.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 1d8223a3d9..b33f4fdced 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -8044,7 +8044,8 @@ gtk_entry_get_current_icon_drag_source (GtkEntry *entry)
* entry in a draw callback.
*
* If the entry is not realized or has no icon at the given position,
- * @icon_area is filled with zeros.
+ * @icon_area is filled with zeros. Otherwise, @icon_area will be filled
+ * with the icon's allocation, relative to @entry's allocation.
*
* See also gtk_entry_get_text_area()
*
@@ -8067,11 +8068,7 @@ gtk_entry_get_icon_area (GtkEntry *entry,
if (icon_info)
{
- GtkAllocation widget_allocation;
- gtk_widget_get_allocation (GTK_WIDGET (entry), &widget_allocation);
- gtk_widget_get_border_allocation (icon_info->widget, icon_area);
- icon_area->x -= widget_allocation.x;
- icon_area->y -= widget_allocation.y;
+ gtk_widget_get_outer_allocation (icon_info->widget, icon_area);
}
else
{