diff options
author | Mike Gorse <mgorse@suse.com> | 2020-05-27 10:47:13 -0500 |
---|---|---|
committer | Mike Gorse <mgorse@suse.com> | 2020-05-27 10:51:25 -0500 |
commit | 053af44c2a270c29ef286abdb3d0b083f05e39a6 (patch) | |
tree | 333d270c2b207bdf3edc16252872f56685947f1c /atspi/atspi-misc.c | |
parent | a8e3e2ef2c3030c563183f4308aa8e63621eac64 (diff) | |
download | at-spi2-core-053af44c2a270c29ef286abdb3d0b083f05e39a6.tar.gz |
Use the event name when sending screen reader events over dbus
For screen reader events, look at the name of the signal and convert it,
rather than hard-coding "RegionChanged." This is necessary to allow
screen_reader_signal_watcher to process signals that will be added in the
future.
https://gitlab.gnome.org/GNOME/orca/issues/36
Diffstat (limited to 'atspi/atspi-misc.c')
-rw-r--r-- | atspi/atspi-misc.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index 9e8595ad..f49041ec 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -1899,3 +1899,33 @@ _atspi_prepare_screen_reader_interface () dbus_connection_add_filter (a11y_bus, screen_reader_filter, NULL, NULL); return TRUE; } + +gchar * +_atspi_strdup_and_adjust_for_dbus (const char *s) +{ + gchar *d = g_strdup (s); + gchar *p; + int parts = 0; + + if (!d) + return NULL; + + for (p = d; *p; p++) + { + if (*p == '-') + { + memmove (p, p + 1, g_utf8_strlen (p, -1)); + *p = toupper (*p); + } + else if (*p == ':') + { + parts++; + if (parts == 2) + break; + p [1] = toupper (p [1]); + } + } + + d [0] = toupper (d [0]); + return d; +} |