[gnome-control-center/wip/hadess/fix-wedged-bluetooth: 4/5] bluetooth: Fix wedged state




commit 76bd047a4c50334a61ddeeb8c4482c659a44c621
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 18 11:04:41 2022 +0100

    bluetooth: Fix wedged state
    
    Fix a state where toggling the main Bluetooth switch in the header will
    always show "Bluetooth turned off", whichever state it's in.
    
    To reproduce, with Bluetooth enabled and working, run
    "hciconfig hci0 down" as root, and launch the Bluetooth panel.
    
    See https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/merge_requests/102

 panels/bluetooth/cc-bluetooth-panel.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/panels/bluetooth/cc-bluetooth-panel.c b/panels/bluetooth/cc-bluetooth-panel.c
index 971ac7ce8..70259cb41 100644
--- a/panels/bluetooth/cc-bluetooth-panel.c
+++ b/panels/bluetooth/cc-bluetooth-panel.c
@@ -100,8 +100,13 @@ airplane_mode_changed_cb (GObject *source_object,
                        g_warning ("Failed to change Bluetooth killswitch state to %s: %s",
                                   state ? "on" : "off", error->message);
        } else {
+               CcBluetoothPanel *self = user_data;
+
                g_debug ("Changed Bluetooth killswitch state to %s",
                         state ? "on" : "off");
+
+               if (!bluetooth_settings_widget_get_default_adapter_powered (self->settings_widget))
+                       bluetooth_settings_widget_set_default_adapter_powered(self->settings_widget, TRUE);
        }
 }
 


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