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