projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
965483e
)
gtk-demo: Fix entry position in dnd demo
author
Matthias Clasen
<mclasen@redhat.com>
Fri, 22 May 2020 17:17:59 +0000
(13:17 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Fri, 22 May 2020 17:17:59 +0000
(13:17 -0400)
gtk_fixed_get_child_position does not work if children
have transforms that are not just 2D translations.
Use gtk_widget_translate_coordinates instead.
demos/gtk-demo/dnd.c
patch
|
blob
|
history
diff --git
a/demos/gtk-demo/dnd.c
b/demos/gtk-demo/dnd.c
index fb164e41a283ebc9977191edee39133856ccaf52..0d901af6de4022cc7a74cce47fe639efe61084f9 100644
(file)
--- a/
demos/gtk-demo/dnd.c
+++ b/
demos/gtk-demo/dnd.c
@@
-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 ();