summaryrefslogtreecommitdiff
path: root/gtk/a11y
diff options
context:
space:
mode:
authorLukáš Tyrychtr <lukastyrychtr@gmail.com>2022-09-12 11:55:06 +0200
committerEmmanuele Bassi <ebassi@gnome.org>2023-02-03 11:49:17 +0100
commit5813a5cace2df1e8e61eb7898031676b22dbbe25 (patch)
treeb0aa229ef6eaed70b519753e330c5d3d08cf3df0 /gtk/a11y
parentf88b777fe5bf4b6e3e14c88c7cdd673b66c13745 (diff)
downloadgtk+-5813a5cace2df1e8e61eb7898031676b22dbbe25.tar.gz
a11y: Add bounds rectangle to GtkAccessible
Make the bounds calculation part of the accessible interface. Bounds are used by ATs like Orca to implement features like Flat Review: https://help.gnome.org/users/orca/stable/howto_flat_review.html.en Or to determine the area of a non-presentational widget.
Diffstat (limited to 'gtk/a11y')
-rw-r--r--gtk/a11y/gtkatspicontext.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c
index adddbd5851..c915281722 100644
--- a/gtk/a11y/gtkatspicontext.c
+++ b/gtk/a11y/gtkatspicontext.c
@@ -1099,29 +1099,9 @@ gtk_at_spi_context_bounds_change (GtkATContext *ctx)
{
GtkAtSpiContext *self = GTK_AT_SPI_CONTEXT (ctx);
GtkAccessible *accessible = gtk_at_context_get_accessible (ctx);
- GtkWidget *widget;
- GtkWidget *parent;
- double x, y;
- int width, height;
-
- if (!GTK_IS_WIDGET (accessible))
- return;
-
- widget = GTK_WIDGET (accessible);
- if (!gtk_widget_get_realized (widget))
- return;
-
- parent = gtk_widget_get_parent (widget);
-
- if (parent)
- gtk_widget_translate_coordinates (widget, parent, 0., 0., &x, &y);
- else
- x = y = 0.;
-
- width = gtk_widget_get_width (widget);
- height = gtk_widget_get_height (widget);
-
- emit_bounds_changed (self, (int)x, (int)y, width, height);
+ int x, y, width, height;
+ if (gtk_accessible_get_bounds (accessible, &x, &y, &width, &height))
+ emit_bounds_changed (self, x, y, width, height);
}
static void