[gnome-bluetooth/wip/hadess/small-fixes: 4/8] lib: Add note about default adapter




commit 5be5f98ca8fc568570656b4a71c171f64ae14e19
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Nov 23 17:28:50 2021 +0100

    lib: Add note about default adapter
    
    The selection of the default adapter depends on the return value from
    g_dbus_object_manager_client_get_objects(), and not quite "the first
    adapter plugged in" (on cold starts at least) as mentioned in
    68852faa5a957d14480e72e8e63bc8e1196d19cf.
    
    Reproduced on Fedora 20.

 lib/bluetooth-client.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index 9839cd71..262cb4d4 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -846,6 +846,12 @@ object_manager_new_callback(GObject      *source_object,
        g_signal_connect_object (G_OBJECT (client->manager), "object-added", (GCallback) object_added, 
client, 0);
        g_signal_connect_object (G_OBJECT (client->manager), "object-removed", (GCallback) object_removed, 
client, 0);
 
+       /* NOTE: Since 2013, in 68852faa5a957d14480e72e8e63bc8e1196d19cf, the default
+        * adapter has been dependent on the order objects are returned from
+        * g_dbus_object_manager_client_get_objects(), which has never not been
+        * tested to have the highest numbered device as the default one.
+        *
+        * It's 2021, and there are no reasons for that to be changed this late. */
        object_list = g_dbus_object_manager_get_objects (client->manager);
 
        /* We need to add the adapters first, otherwise the devices will


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]