summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2018-07-23 10:09:55 -0300
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2018-07-23 10:13:13 -0300
commit88c30e8fbd9c9aeee548747f9f0e261ae49bec32 (patch)
treed5798132113b911c06c8ab9451d243790abf4514
parentb9da351a3dec660e0de3d7e1673383ccd6d2d017 (diff)
downloadgnome-control-center-88c30e8fbd9c9aeee548747f9f0e261ae49bec32.tar.gz
wifi: Keep Airplane Mode always synchronized
Currently, we acquire the Rfkill D-Bus proxy and synchronize the state right after that. However, we don't monitor for subsequent changes by connecting to the 'g-properties-changed' GDBusProxy signal, which causes the Airplane Mode not to stay synchronized when modified from others places, such as GNOME Shell's aggregate menu. This commit adds the necessary signal monitoring code to react to external applications changing the Rfkill properties.
-rw-r--r--panels/network/cc-wifi-panel.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/panels/network/cc-wifi-panel.c b/panels/network/cc-wifi-panel.c
index 2448f87a2..09e16baf8 100644
--- a/panels/network/cc-wifi-panel.c
+++ b/panels/network/cc-wifi-panel.c
@@ -480,6 +480,17 @@ wireless_enabled_cb (NMClient *client,
}
static void
+on_rfkill_proxy_properties_changed_cb (GDBusProxy *proxy,
+ GVariant *changed_properties,
+ GStrv invalidated_properties,
+ CcWifiPanel *self)
+{
+ g_debug ("Rfkill properties changed");
+
+ sync_airplane_mode_switch (self);
+}
+
+static void
rfkill_proxy_acquired_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
@@ -504,6 +515,12 @@ rfkill_proxy_acquired_cb (GObject *source_object,
self->rfkill_proxy = proxy;
+ g_signal_connect_object (proxy,
+ "g-properties-changed",
+ G_CALLBACK (on_rfkill_proxy_properties_changed_cb),
+ self,
+ 0);
+
sync_airplane_mode_switch (self);
}