44 lines
1.5 KiB
Diff
44 lines
1.5 KiB
Diff
From a9fb853fea178875247f0e8615d5714b60b77f8b Mon Sep 17 00:00:00 2001
|
|
From: Mike Gorse <mgorse@suse.com>
|
|
Date: Wed, 9 Jul 2025 16:15:22 -0500
|
|
Subject: [PATCH] atk-bridge: Don't crash when requesting a plug if not
|
|
activated
|
|
|
|
This isn't really a complete fix. The format of the plug string relies on
|
|
an application's name on the accessibility bus, but, if, for instance, the
|
|
screen reader is turned off and back on, then it is possible for the
|
|
accessibility bus to be taken down and later recreated (see #193). We should
|
|
perhaps construct some sort of well-known name that can be set on the bus,
|
|
while ensuring that we don't conflict with any other application.
|
|
|
|
But this is a quick fix that is at least an improvement over a crash.
|
|
|
|
Closes #198
|
|
---
|
|
atk-adaptor/bridge.c | 6 +++++-
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c
|
|
index 4b71128b..a3526406 100644
|
|
--- a/atk-adaptor/bridge.c
|
|
+++ b/atk-adaptor/bridge.c
|
|
@@ -514,10 +514,14 @@ static AtkSocketClass *socket_class;
|
|
static gchar *
|
|
get_plug_id (AtkPlug *plug)
|
|
{
|
|
- const char *uname = dbus_bus_get_unique_name (spi_global_app_data->bus);
|
|
+ const char *uname;
|
|
gchar *path;
|
|
GString *str = g_string_new (NULL);
|
|
|
|
+ if (!spi_global_app_data || !spi_global_app_data->bus)
|
|
+ return NULL;
|
|
+
|
|
+ uname = dbus_bus_get_unique_name (spi_global_app_data->bus);
|
|
path = spi_register_object_to_path (spi_global_register, G_OBJECT (plug));
|
|
g_string_printf (str, "%s:%s", uname, path);
|
|
g_free (path);
|
|
--
|
|
2.50.0
|
|
|