diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2021-01-12 11:15:28 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2021-01-12 11:15:28 +0000 |
commit | 03b60a2d5e40da1b137117aba05a2c818edd09b3 (patch) | |
tree | 5aa9a102dcb89397b0e0a6163aa0b946fb2bc404 /gtk/a11y | |
parent | 506423cf23be826851715c97be976278b15d65b9 (diff) | |
download | gtk+-03b60a2d5e40da1b137117aba05a2c818edd09b3.tar.gz |
a11y: Sanitize the AT-SPI object path further
When falling back to g_get_prgname(), we need to take into account that
the program name may be the full argv[0] path, which will end up messing
the DBus object path.
Diffstat (limited to 'gtk/a11y')
-rw-r--r-- | gtk/a11y/gtkatspiroot.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gtk/a11y/gtkatspiroot.c b/gtk/a11y/gtkatspiroot.c index 48c9e60676..6aa1048841 100644 --- a/gtk/a11y/gtkatspiroot.c +++ b/gtk/a11y/gtkatspiroot.c @@ -667,8 +667,16 @@ gtk_at_spi_root_constructed (GObject *gobject) { const char *program_name = g_get_prgname (); + char *base_name = NULL; + if (program_name == NULL || *program_name == 0) + base_name = g_strdup ("unknown"); + else if (*program_name == '/') + base_name = g_path_get_basename (program_name); + else + base_name = g_strdup (program_name); + self->base_path = g_strconcat ("/org/gtk/application/", - program_name != NULL ? program_name : "unknown", + base_name, "/a11y", NULL); |