[gnome-bluetooth/wip/hadess/lib-changes: 5/8] lib: Add note about default adapter




commit 91d8d7caa733739a6f25b22be7f7caa86044bd03
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 4529b369..d0dba02a 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -839,6 +839,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]