Blame SOURCES/0001-sharing-Remember-the-password-on-remote-desktop-shar.patch

b28b5c
From 718426652881a9e0cb1ddffb0af0f58128396a23 Mon Sep 17 00:00:00 2001
b28b5c
From: Carlos Garnacho <carlosg@gnome.org>
b28b5c
Date: Tue, 11 Feb 2020 19:10:15 +0100
b28b5c
Subject: [PATCH] sharing: Remember the password on remote desktop sharing
b28b5c
b28b5c
If we are going through mutter's RemoteDesktop interface, we don't
b28b5c
seemingly remember the password set. Add support for reading it
b28b5c
from secrets and change the entry password on dialog construction,
b28b5c
to bring it on par with our vino handling.
b28b5c
---
b28b5c
 panels/sharing/cc-gnome-remote-desktop.c | 16 ++++++++++++++++
b28b5c
 panels/sharing/cc-gnome-remote-desktop.h |  2 ++
b28b5c
 panels/sharing/cc-sharing-panel.c        |  2 ++
b28b5c
 3 files changed, 20 insertions(+)
b28b5c
b28b5c
diff --git a/panels/sharing/cc-gnome-remote-desktop.c b/panels/sharing/cc-gnome-remote-desktop.c
b28b5c
index 8420fddca..599467fb4 100644
b28b5c
--- a/panels/sharing/cc-gnome-remote-desktop.c
b28b5c
+++ b/panels/sharing/cc-gnome-remote-desktop.c
b28b5c
@@ -169,3 +169,19 @@ cc_grd_on_vnc_password_entry_notify_text (GtkEntry   *entry,
b28b5c
                          cancellable, on_password_stored, entry,
b28b5c
                          NULL);
b28b5c
 }
b28b5c
+
b28b5c
+void
b28b5c
+cc_grd_update_password_entry (GtkEntry *entry)
b28b5c
+{
b28b5c
+  g_autoptr(GError) error = NULL;
b28b5c
+  g_autofree gchar *password = NULL;
b28b5c
+
b28b5c
+  password = secret_password_lookup_sync (CC_GRD_VNC_PASSWORD_SCHEMA,
b28b5c
+                                          NULL, &error,
b28b5c
+                                          NULL);
b28b5c
+  if (error)
b28b5c
+    g_critical ("Failed to get password: %s", error->message);
b28b5c
+
b28b5c
+  if (password)
b28b5c
+    gtk_entry_set_text (entry, password);
b28b5c
+}
b28b5c
diff --git a/panels/sharing/cc-gnome-remote-desktop.h b/panels/sharing/cc-gnome-remote-desktop.h
b28b5c
index 2a4819986..1f83e2dd6 100644
b28b5c
--- a/panels/sharing/cc-gnome-remote-desktop.h
b28b5c
+++ b/panels/sharing/cc-gnome-remote-desktop.h
b28b5c
@@ -46,4 +46,6 @@ void cc_grd_on_vnc_password_entry_notify_text (GtkEntry   *entry,
b28b5c
                                                GParamSpec *pspec,
b28b5c
                                                gpointer    user_data);
b28b5c
 
b28b5c
+void cc_grd_update_password_entry (GtkEntry *entry);
b28b5c
+
b28b5c
 #endif /* CC_GNOME_REMOTE_DESKTOP_H */
b28b5c
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c
b28b5c
index ab22f5df8..17ecdb11a 100644
b28b5c
--- a/panels/sharing/cc-sharing-panel.c
b28b5c
+++ b/panels/sharing/cc-sharing-panel.c
b28b5c
@@ -1106,6 +1106,8 @@ cc_sharing_panel_setup_screen_sharing_dialog_gnome_remote_desktop (CcSharingPane
b28b5c
   g_signal_connect (priv->screen_sharing_dialog, "hide",
b28b5c
                     G_CALLBACK (screen_sharing_hide_cb), self);
b28b5c
 
b28b5c
+  cc_grd_update_password_entry (WID ("remote-control-password-entry"));
b28b5c
+
b28b5c
   /* accept at most 8 bytes in password entry */
b28b5c
   g_signal_connect (WID ("remote-control-password-entry"), "insert-text",
b28b5c
                     G_CALLBACK (screen_sharing_password_insert_text_cb), self);
b28b5c
-- 
b28b5c
2.24.1
b28b5c