43 lines
1.6 KiB
Diff
43 lines
1.6 KiB
Diff
From cd6a4902b321eb7c8ab340adbebc14bd8f1e07d5 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= <ltyrycht@redhat.com>
|
|
Date: Thu, 27 Mar 2025 14:48:30 +0100
|
|
Subject: [PATCH] device-a11y-manager: Check properly for the DBus backend
|
|
presence
|
|
|
|
The DBusProxy creation succeds even if the object does not exist.
|
|
So, check for the unique name of the object, this will be set only if the
|
|
a11y manager actually exists.
|
|
---
|
|
atspi/atspi-device-a11y-manager.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/atspi/atspi-device-a11y-manager.c b/atspi/atspi-device-a11y-manager.c
|
|
index 1939b3bf..8ecd791c 100644
|
|
--- a/atspi/atspi-device-a11y-manager.c
|
|
+++ b/atspi/atspi-device-a11y-manager.c
|
|
@@ -528,6 +528,7 @@ AtspiDeviceA11yManager *
|
|
atspi_device_a11y_manager_try_new_full (const gchar *app_id)
|
|
{
|
|
GError *error = NULL;
|
|
+ g_autofree gchar *owner = NULL;
|
|
GDBusConnection *session_bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
|
|
GDBusProxy *keyboard_monitor = g_dbus_proxy_new_sync (session_bus,
|
|
G_DBUS_PROXY_FLAGS_NONE,
|
|
@@ -545,6 +546,14 @@ atspi_device_a11y_manager_try_new_full (const gchar *app_id)
|
|
return NULL;
|
|
}
|
|
|
|
+ owner = g_dbus_proxy_get_name_owner (keyboard_monitor);
|
|
+ if (!owner)
|
|
+ {
|
|
+ g_clear_object (&session_bus);
|
|
+ g_clear_object (&keyboard_monitor);
|
|
+ return NULL;
|
|
+ }
|
|
+
|
|
AtspiDeviceA11yManager *device = g_object_new (ATSPI_TYPE_DEVICE_A11Y_MANAGER,
|
|
"session-bus", session_bus,
|
|
"keyboard-monitor", keyboard_monitor,
|
|
--
|
|
GitLab
|
|
|