[gnome-bluetooth/benzea/disable-discovering-on-widget-destruction: 3/3] settings: Disable discovering when settings widget is destroyed



commit 44e4014f1c049bdc072e73160cd6a3f657e6d6b2
Author: Benjamin Berg <bberg redhat com>
Date:   Mon Mar 18 15:55:44 2019 +0100

    settings: Disable discovering when settings widget is destroyed
    
    As with discoverability, we need to disable discovery when the settings
    widget is destroyed. This fixes an issue where we keep discovering when
    switching away from the bluetooth panel in g-c-c. This is mainly an
    issue as it may impact the performance of established bluetooth
    connections.

 lib/bluetooth-settings-widget.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c
index efa09521..da1898fa 100644
--- a/lib/bluetooth-settings-widget.c
+++ b/lib/bluetooth-settings-widget.c
@@ -1974,8 +1974,10 @@ bluetooth_settings_widget_finalize (GObject *object)
 
        /* See default_adapter_changed () */
        /* FIXME: This is blocking */
-       if (priv->client)
+       if (priv->client) {
+               g_object_set (G_OBJECT (priv->client), "default-adapter-discovering", FALSE, NULL);
                g_object_set (G_OBJECT (priv->client), "default-adapter-discoverable", FALSE, NULL);
+       }
 
        g_cancellable_cancel (priv->cancellable);
        g_clear_object (&priv->cancellable);


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