[PATCH v2 7/7] When entry with focus gets password from gnome-keyring, select the full region (cherry picked from commit eee2f4fd0f1aa3e2439c9ca337b00f5a382d9b8e)



Signed-off-by: Murilo Opsfelder Araujo <muriloo linux vnet ibm com>
---
 auth-dialog/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index d688b27..cef3504 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -674,8 +674,12 @@ static void got_keyring_pw(GnomeKeyringResult result, const char *string, gpoint
 	ui_fragment_data *data = (ui_fragment_data*)userdata;
 	if (string != NULL) {
 		if (data->entry) {
-			if (g_ascii_strncasecmp("", gtk_entry_get_text(GTK_ENTRY(data->entry)), 0) == 0)
+			if (!g_ascii_strcasecmp("",
+						gtk_entry_get_text(GTK_ENTRY(data->entry)))) {
 				gtk_entry_set_text(GTK_ENTRY(data->entry), string);
+				if (gtk_widget_has_focus(data->entry))
+					gtk_editable_select_region(GTK_EDITABLE(data->entry), 0, -1);
+			}
 		} else
 			data->entry_text = g_strdup (string);
 
-- 
1.8.0



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]