summaryrefslogtreecommitdiff
path: root/gtk/a11y
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-06-02 14:32:41 +0200
committerCarlos Garnacho <carlosg@gnome.org>2022-06-02 14:35:53 +0200
commite895f7dd7018e1af3f238c7f4fd0bd5f1fafe1df (patch)
treebb041febf43746dd255eb7a62fee26238663affa /gtk/a11y
parent7750a2c42362db7d2de7a0b05efd17372dcfc625 (diff)
downloadgtk+-e895f7dd7018e1af3f238c7f4fd0bd5f1fafe1df.tar.gz
a11y: Transform GetCharacterExtents coords to native surface ones
These coordinates are "window"-relative, so transform textview coordinates to the coordinate system of the GtkNative containing it.
Diffstat (limited to 'gtk/a11y')
-rw-r--r--gtk/a11y/gtkatspitext.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk/a11y/gtkatspitext.c b/gtk/a11y/gtkatspitext.c
index 5bac320813..e4a6140298 100644
--- a/gtk/a11y/gtkatspitext.c
+++ b/gtk/a11y/gtkatspitext.c
@@ -1126,6 +1126,13 @@ text_view_handle_method (GDBusConnection *connection,
rect.x, rect.y,
&x, &y);
+ double dx, dy;
+ gtk_widget_translate_coordinates (widget,
+ GTK_WIDGET (gtk_widget_get_native (widget)),
+ (double) x, (double) y, &dx, &dy);
+ x = floor (dx);
+ y = floor (dy);
+
g_dbus_method_invocation_return_value (invocation,
g_variant_new ("(iiii)",
x,