gtk-demo: Fix entry position in dnd demo

gtk_fixed_get_child_position does not work if children
have transforms that are not just 2D translations.
Use gtk_widget_translate_coordinates instead.
This commit is contained in:
Matthias Clasen 2020-05-22 13:17:59 -04:00
parent 965483eb67
commit e54060bac2

View File

@ -309,9 +309,9 @@ edit_cb (GtkWidget *button, GtkWidget *child)
GtkWidget *canvas = gtk_widget_get_parent (child);
CanvasItem *item = CANVAS_ITEM (child);
GtkWidget *entry;
int x, y;
double x, y;
gtk_fixed_get_child_position (GTK_FIXED (canvas), child, &x, &y);
gtk_widget_translate_coordinates (child, canvas, 0, 0, &x, &y);
entry = gtk_entry_new ();