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.
This commit is contained in:
parent
b9da351a3d
commit
88c30e8fbd
1 changed files with 17 additions and 0 deletions
|
@ -479,6 +479,17 @@ wireless_enabled_cb (NMClient *client,
|
|||
check_main_stack_page (self);
|
||||
}
|
||||
|
||||
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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue