sharing: Connect to the active property instead of state

The ability to tweak the state property was mainly introduced in
order to implement delayed state change via the state-set signal.
Since GTK 4.9.3[1] the active and state properties are no more
interchangeable.

[1] https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5442
This commit is contained in:
Alessandro Bono 2023-02-05 15:07:00 +01:00 committed by Georges Basile Stavracas Neto
parent b892e6ff15
commit 4cacdb3544

View file

@ -1063,9 +1063,9 @@ enable_gnome_remote_desktop (CcSharingPanel *self)
} }
static void static void
on_remote_desktop_state_changed (GtkWidget *widget, on_remote_desktop_active_changed (GtkWidget *widget,
GParamSpec *pspec, GParamSpec *pspec,
CcSharingPanel *self) CcSharingPanel *self)
{ {
if (gtk_switch_get_active (GTK_SWITCH (widget))) if (gtk_switch_get_active (GTK_SWITCH (widget)))
enable_gnome_remote_desktop (self); enable_gnome_remote_desktop (self);
@ -1313,8 +1313,8 @@ cc_sharing_panel_setup_remote_desktop_dialog (CcSharingPanel *self)
"clicked", G_CALLBACK (on_password_copy_clicked), "clicked", G_CALLBACK (on_password_copy_clicked),
self); self);
g_signal_connect (self->remote_desktop_switch, "notify::state", g_signal_connect (self->remote_desktop_switch, "notify::active",
G_CALLBACK (on_remote_desktop_state_changed), self); G_CALLBACK (on_remote_desktop_active_changed), self);
if (is_remote_desktop_enabled (self)) if (is_remote_desktop_enabled (self))
{ {