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



commit e32ca9757e8c298d31c670f53a3d50c95d7a3d61
Author: Benjamin Berg <bberg redhat com>
Date:   Mon Mar 18 14:30:17 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 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c
index 497c1999..62377201 100644
--- a/lib/bluetooth-settings-widget.c
+++ b/lib/bluetooth-settings-widget.c
@@ -1352,10 +1352,9 @@ default_adapter_changed (BluetoothClient  *client,
 
        g_debug ("Default adapter changed to: %s", default_adapter ? default_adapter : "(none)");
 
-       g_object_set (G_OBJECT (client), "default-adapter-discovering", default_adapter != NULL, NULL);
-
        /* FIXME: This should turn off automatically when
         * the settings panel goes away */
+       g_object_set (G_OBJECT (client), "default-adapter-discovering", default_adapter != NULL, NULL);
        g_object_set (G_OBJECT (client), "default-adapter-discoverable", default_adapter != NULL, NULL);
 
        g_signal_emit (G_OBJECT (self), signals[ADAPTER_STATUS_CHANGED], 0);
@@ -1977,8 +1976,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]