[gtk/ebassi/a11y-text-extents] a11y: Transform GetCharacterExtents coords to native surface ones
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ebassi/a11y-text-extents] a11y: Transform GetCharacterExtents coords to native surface ones
- Date: Thu, 2 Jun 2022 12:37:14 +0000 (UTC)
commit e895f7dd7018e1af3f238c7f4fd0bd5f1fafe1df
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Jun 2 14:32:41 2022 +0200
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.
gtk/a11y/gtkatspitext.c | 7 +++++++
1 file changed, 7 insertions(+)
---
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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]