[gnome-bluetooth/wip/hadess/fix-keyboard-cancel: 4/10] lib: Make setting discovery asynchronous




commit 2c236bebf7c26bfc9eb5d669e66576f29c5042c9
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Feb 19 12:59:36 2021 +0100

    lib: Make setting discovery asynchronous
    
    In some circumstances, setting the discovery mode might be a bit long,
    usually because there's another action pending, so send it async. D-Bus
    guarantees that the messages will get to the daemon in the same sequence
    we sent them, so we're just delaying the changes a bit.

 lib/bluetooth-client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index a4365535..367bdc13 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -995,9 +995,9 @@ _bluetooth_client_set_default_adapter_discovering (BluetoothClient *client,
 
        priv->discovery_started = discovering;
        if (discovering)
-               adapter1_call_start_discovery_sync (ADAPTER1 (adapter), NULL, NULL);
+               adapter1_call_start_discovery (ADAPTER1 (adapter), NULL, NULL, NULL);
        else
-               adapter1_call_stop_discovery_sync (ADAPTER1 (adapter), NULL, NULL);
+               adapter1_call_stop_discovery (ADAPTER1 (adapter), NULL, NULL, NULL);
 }
 
 static gboolean


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