Compare commits

..

3 Commits

Author SHA1 Message Date
Emmanuele Bassi 48ea50510f inspector: Remove the GtkAtSpiContext use
There is generic API to access the D-Bus object path of the
accessibility context object.
2023-02-04 12:17:47 +01:00
Emmanuele Bassi d31450929f a11y: Implement get_dbus_object_path() for AT-SPI context
Implement the vfunc from the parent GtkATContextClass vtable.
2023-02-04 12:16:59 +01:00
Emmanuele Bassi 1b4adc4ed8 a11y: Add accessor for D-Bus object path
ATContext instances that use D-Bus have an object path that is usable to
access the accessible object on the accessibility bus. This allows
constructing bridges between processes for complex scenarios, like
having a split UI and document rendering processes.
2023-02-04 12:14:14 +01:00
9 changed files with 73 additions and 23 deletions
+1 -10
View File
@@ -1,4 +1,4 @@
Overview of Changes in 4.9.3, 04-02-2023
Overview of Changes in 4.9.3, xx-xx-xxxx
========================================
* Add GtkUriLauncher, as replacement for gtk_show_uri
@@ -25,15 +25,6 @@ Overview of Changes in 4.9.3, 04-02-2023
* GtkSwitch:
- Make state and active independently settable
* GtkFileChooser:
- Fix a crash with DND
- Fix excessively wide sidebar
- Make context menus work again
* Accessibility:
- Make GtkAccessible public, so it can be implemented outside GTK
- Support accessible implementation for editables
* CSS:
- Fix randomly stopping CSS animations
+12 -3
View File
@@ -2066,10 +2066,19 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
xev->detail != XINotifyInferior && xev->mode != XINotifyPassiveUngrab &&
GDK_IS_TOPLEVEL (surface))
{
GList *l;
if (gdk_x11_device_xi2_get_device_type ((GdkX11DeviceXI2 *) device) != GDK_X11_DEVICE_TYPE_LOGICAL)
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device));
else
{
GList *physical_devices, *l;
for (l = device_manager->devices; l; l = l->next)
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (l->data));
physical_devices = gdk_device_list_physical_devices (source_device);
for (l = physical_devices; l; l = l->next)
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (l->data));
g_list_free (physical_devices);
}
}
event = gdk_crossing_event_new (ev->evtype == XI_Enter
+9
View File
@@ -1394,6 +1394,14 @@ gtk_at_spi_context_unrealize (GtkATContext *context)
g_clear_object (&self->root);
}
static const char *
gtk_at_spi_context_get_dbus_object_path (GtkATContext *context)
{
GtkAtSpiContext *self = GTK_AT_SPI_CONTEXT (context);
return self->context_path;
}
static void
gtk_at_spi_context_class_init (GtkAtSpiContextClass *klass)
{
@@ -1409,6 +1417,7 @@ gtk_at_spi_context_class_init (GtkAtSpiContextClass *klass)
context_class->platform_change = gtk_at_spi_context_platform_change;
context_class->bounds_change = gtk_at_spi_context_bounds_change;
context_class->child_change = gtk_at_spi_context_child_change;
context_class->get_dbus_object_path = gtk_at_spi_context_get_dbus_object_path;
}
static void
+34
View File
@@ -1152,3 +1152,37 @@ gtk_at_context_child_changed (GtkATContext *self,
GTK_AT_CONTEXT_GET_CLASS (self)->child_change (self, change, child);
}
/**
* gtk_at_context_get_dbus_object_path:
* @self: an accessibility context
*
* Returns the D-Bus object path of the accessibility context.
*
* If the accessibility context uses a D-Bus transport, the return value is
* the path at which you will be able to find the object.
*
* This function returns `NULL` if the accessibility context is unrealized,
* or it does not use D-Bus, or if the accessibility support has been
* disabled.
*
* Returns: (nullable) (transfer none): the D-Bus object path of the
* accessibility context
*
* Since: 4.10
*/
const char *
gtk_at_context_get_dbus_object_path (GtkATContext *self)
{
g_return_val_if_fail (GTK_IS_AT_CONTEXT (self), NULL);
if (!self->realized)
return FALSE;
GtkATContextClass *klass = GTK_AT_CONTEXT_GET_CLASS (self);
if (klass->get_dbus_object_path != NULL)
return klass->get_dbus_object_path (self);
else
return NULL;
}
+3
View File
@@ -45,4 +45,7 @@ GtkATContext * gtk_at_context_create (GtkAccessibleRo
GtkAccessible *accessible,
GdkDisplay *display);
GDK_AVAILABLE_IN_4_10
const char * gtk_at_context_get_dbus_object_path (GtkATContext *self);
G_END_DECLS
+2
View File
@@ -124,6 +124,8 @@ struct _GtkATContextClass
void (* realize) (GtkATContext *self);
void (* unrealize) (GtkATContext *self);
const char * (* get_dbus_object_path) (GtkATContext *self);
};
GtkATContext * gtk_at_context_clone (GtkATContext *self,
+4 -1
View File
@@ -337,6 +337,8 @@ gtk_stack_page_finalize (GObject *object)
g_object_remove_weak_pointer (G_OBJECT (page->last_focus),
(gpointer *)&page->last_focus);
g_clear_object (&page->at_context);
G_OBJECT_CLASS (gtk_stack_page_parent_class)->finalize (object);
}
@@ -345,7 +347,8 @@ gtk_stack_page_dispose (GObject *object)
{
GtkStackPage *page = GTK_STACK_PAGE (object);
g_clear_object (&page->at_context);
if (page->at_context != NULL)
gtk_at_context_unrealize (page->at_context);
G_OBJECT_CLASS (gtk_stack_page_parent_class)->dispose (object);
}
+7 -8
View File
@@ -34,9 +34,6 @@
#include "gtknoselection.h"
#include "gtkfilterlistmodel.h"
#include "gtkboolfilter.h"
#ifdef G_OS_UNIX
#include "a11y/gtkatspicontextprivate.h"
#endif
typedef enum {
STATE,
@@ -233,17 +230,19 @@ update_path (GtkInspectorA11y *sl)
const char *path = "";
#ifdef G_OS_UNIX
GtkATContext *context;
const char *context_path;
context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
if (GTK_IS_AT_SPI_CONTEXT (context))
context_path = gtk_at_context_get_dbus_object_path (context);
if (context_path == NULL)
{
if (gtk_at_context_is_realized (context))
path = gtk_at_spi_context_get_context_path (GTK_AT_SPI_CONTEXT (context));
else
if (!gtk_at_context_is_realized (context))
path = "not realized";
else
path = "not available on accessibility bus";
}
else
path = "not on bus";
path = context_path;
#endif
gtk_label_set_label (GTK_LABEL (sl->path), path);
+1 -1
View File
@@ -13,7 +13,7 @@ fi
meson subprojects update gi-docgen
# make the release tarball
meson setup -Dintrospection=enabled -Dgtk_doc=true --force-fallback-for gi-docgen ${release_build_dir} || exit
meson setup -Dgtk_doc=true --force-fallback-for gi-docgen ${release_build_dir} || exit
meson compile -C${release_build_dir} || exit
meson dist -C${release_build_dir} --include-subprojects || exit