Commit a5de11c3 authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Carlos Garnacho
Browse files

sharing: Remember the password on remote desktop sharing

If we are going through mutter's RemoteDesktop interface, we don't
seemingly remember the password set. Add support for reading it
from secrets and change the entry password on dialog construction,
to bring it on par with our vino handling.
parent d6cfba1a
...@@ -169,3 +169,19 @@ cc_grd_on_vnc_password_entry_notify_text (GtkEntry *entry, ...@@ -169,3 +169,19 @@ cc_grd_on_vnc_password_entry_notify_text (GtkEntry *entry,
cancellable, on_password_stored, entry, cancellable, on_password_stored, entry,
NULL); NULL);
} }
void
cc_grd_update_password_entry (GtkEntry *entry)
{
g_autoptr(GError) error = NULL;
g_autofree gchar *password = NULL;
password = secret_password_lookup_sync (CC_GRD_VNC_PASSWORD_SCHEMA,
NULL, &error,
NULL);
if (error)
g_warning ("Failed to get password: %s", error->message);
if (password)
gtk_entry_set_text (entry, password);
}
...@@ -47,4 +47,6 @@ void cc_grd_on_vnc_password_entry_notify_text (GtkEntry *entry, ...@@ -47,4 +47,6 @@ void cc_grd_on_vnc_password_entry_notify_text (GtkEntry *entry,
GParamSpec *pspec, GParamSpec *pspec,
gpointer user_data); gpointer user_data);
void cc_grd_update_password_entry (GtkEntry *entry);
G_END_DECLS G_END_DECLS
...@@ -1110,6 +1110,8 @@ cc_sharing_panel_setup_screen_sharing_dialog_gnome_remote_desktop (CcSharingPane ...@@ -1110,6 +1110,8 @@ cc_sharing_panel_setup_screen_sharing_dialog_gnome_remote_desktop (CcSharingPane
G_CALLBACK (screen_sharing_hide_cb), G_CALLBACK (screen_sharing_hide_cb),
self); self);
cc_grd_update_password_entry (self->remote_control_password_entry);
/* accept at most 8 bytes in password entry */ /* accept at most 8 bytes in password entry */
g_signal_connect (self->remote_control_password_entry, g_signal_connect (self->remote_control_password_entry,
"insert-text", "insert-text",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment