system: Update subtitle of Remote Desktop row earlier

The Remote Desktop page subtitle was updated asynchronously when
the System panel was loaded but after the following steps:

1. Connection established to `org.gnome.SettingsDaemon.Sharing`
(handled on `sharing_proxy_ready`).
2. Then a check whether Remote Desktop is available by watching
the `org.gnome.Mutter.RemoteDesktop` bus name appear.
3. Then we are finally populating the UI (and updating the
subtitle).

Now we bypass the panel initialization and check directly for the
"enable" state of the backend GSetting and the availability of the
gnome-remote-desktop.service, using `is_remote_desktop_enabled()`.

Fixes #2772
This commit is contained in:
Felipe Borges 2023-11-30 10:00:59 +01:00
parent 0427e160bd
commit 80d476d9d7

View file

@ -600,8 +600,6 @@ cc_remote_desktop_page_setup_remote_desktop_dialog (CcRemoteDesktopPage *self)
self->remote_control_switch, "sensitive",
G_BINDING_SYNC_CREATE);
update_page_summary (self);
hostname = get_hostname ();
gtk_label_set_label (GTK_LABEL (self->remote_desktop_device_name_label),
hostname);
@ -758,6 +756,10 @@ cc_remote_desktop_page_init (CcRemoteDesktopPage *self)
gtk_widget_init_template (GTK_WIDGET (self));
gtk_switch_set_active (GTK_SWITCH (self->remote_desktop_switch),
is_remote_desktop_enabled (self));
update_page_summary (self);
self->cancellable = g_cancellable_new ();
gsd_sharing_proxy_new_for_bus (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,