mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-30 15:31:34 +00:00
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.
This commit is contained in:
parent
506423cf23
commit
03b60a2d5e
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user