Blob Blame Raw
--- gdm-2.19.3/gui/gdmlogin.c.move-default-message	2007-06-17 13:07:27.000000000 -0400
+++ gdm-2.19.3/gui/gdmlogin.c	2007-06-18 15:15:37.000000000 -0400
@@ -169,6 +169,7 @@
 extern const gchar *current_session;
 extern gboolean session_dir_whacked_out;
 extern gint gdm_timed_delay;
+static gboolean using_fallback_message = FALSE;
 
 static gboolean first_prompt = TRUE;
 
@@ -1357,9 +1358,20 @@
 					gdm_config_get_string (GDM_KEY_SOUND_ON_LOGIN_FILE),
 					gdm_config_get_bool   (GDM_KEY_SOUND_ON_LOGIN));
 		gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("_Username:"));
+                if (ve_string_empty (gtk_label_get_text (GTK_LABEL (msg)))) {
+                        gtk_label_set_text (GTK_LABEL (msg),
+                                            _("Please enter your username"));
+                        using_fallback_message = TRUE;
+                }
+
 	} else {
 		if (tmp != NULL)
 			gtk_label_set_text (GTK_LABEL (label), tmp);
+                if (using_fallback_message) {
+                        gtk_label_set_text (GTK_LABEL (msg), "");
+                        using_fallback_message = FALSE;
+                }
+
 	}
 	g_free (tmp);
 
@@ -1447,6 +1459,7 @@
 		g_free (tmp);
 	}
 	replace_msg = FALSE;
+	using_fallback_message = FALSE;
 
 	gtk_widget_show (GTK_WIDGET (msg));
 	printf ("%c\n", STX);
@@ -1625,9 +1638,7 @@
 	if (browser_ok && gdm_config_get_bool (GDM_KEY_BROWSER))
 	    gtk_widget_set_sensitive (GTK_WIDGET (browser), TRUE);
 
-	tmp = ve_locale_to_utf8 (args);
-	gtk_label_set_text (GTK_LABEL (msg), tmp);
-	g_free (tmp);
+	gtk_label_set_text (GTK_LABEL (msg), "");
 	gtk_widget_show (GTK_WIDGET (msg));
 
 	printf ("%c\n", STX);
--- gdm-2.19.3/gui/greeter/greeter_item_pam.c.move-default-message	2007-06-17 13:07:26.000000000 -0400
+++ gdm-2.19.3/gui/greeter/greeter_item_pam.c	2007-06-18 15:15:37.000000000 -0400
@@ -47,6 +47,7 @@
 gboolean require_quarter = FALSE;
 
 extern gboolean greeter_probably_login_prompt;
+static gboolean using_fallback_message = FALSE;
 extern GtkButton *gtk_ok_button;
 extern GtkButton *gtk_start_again_button;
 
@@ -241,13 +242,35 @@
 			 int         entry_len,
 			 gboolean    entry_visible)
 {
+  GreeterItemInfo *message_info;
   GreeterItemInfo *conversation_info;
   GreeterItemInfo *entry_info;
   GtkWidget *entry;
 
+  message_info = greeter_lookup_id ("pam-message");
   conversation_info = greeter_lookup_id ("pam-prompt");
   entry_info = greeter_lookup_id ("user-pw-entry");
 
+  if (strcmp (message, _("Username:")) == 0 && message_info)
+    {
+      gchar *text;
+      text = NULL;
+      g_object_get (G_OBJECT (message_info->item),
+                    "text", &text,
+                    NULL);
+      if (ve_string_empty (text))
+        {
+          set_text (message_info, _("Please enter your username"));
+          using_fallback_message = TRUE;
+        }
+      g_free (text);
+    } 
+  else if (using_fallback_message)
+    {
+      set_text (message_info, "");
+      using_fallback_message = FALSE;
+    }
+
   if (conversation_info)
     {
       set_text (conversation_info, message);
@@ -312,6 +335,7 @@
        * we try to collect them until the next prompt or reset or
        * whatnot */
       if ( ! replace_msg &&
+	   ! using_fallback_message &&
 	   /* empty message is for clearing */
 	   ! ve_string_empty (message))
 	{
@@ -331,6 +355,7 @@
         set_text (message_info, message);
     }
   replace_msg = FALSE;
+  using_fallback_message = FALSE;
 }
 
 
--- gdm-2.19.3/daemon/verify-pam.c.move-default-message	2007-06-17 13:07:38.000000000 -0400
+++ gdm-2.19.3/daemon/verify-pam.c	2007-06-18 15:17:19.000000000 -0400
@@ -540,12 +540,6 @@
 		case PAM_PROMPT_ECHO_ON:
 			if (strcmp (m, _("Username:")) == 0) {
 				if (ve_string_empty (selected_user)) {
-					/* this is an evil hack, but really there is no way we'll
-					   know this is a username prompt.  However we SHOULD NOT
-					   rely on this working.  The pam modules can set their
-					   prompt to whatever they wish to */
-					gdm_slave_greeter_ctl_no_ret
-						(GDM_MSG, _("Please enter your username"));
 					s = gdm_slave_greeter_ctl (GDM_PROMPT, m);
 					/* this will clear the message */
 					gdm_slave_greeter_ctl_no_ret (GDM_MSG, "");
--- gdm-2.19.3/daemon/verify-crypt.c.move-default-message	2007-06-17 13:07:39.000000000 -0400
+++ gdm-2.19.3/daemon/verify-crypt.c	2007-06-18 15:15:37.000000000 -0400
@@ -125,7 +125,6 @@
 	authenticate_again:
 		/* Ask for the user's login */
 		gdm_verify_select_user (NULL);
-		gdm_slave_greeter_ctl_no_ret (GDM_MSG, _("Please enter your username"));
 		login = gdm_slave_greeter_ctl (GDM_PROMPT, _("Username:"));
 		if (login == NULL ||
 		    gdm_slave_greeter_check_interruption ()) {
--- gdm-2.19.3/daemon/verify-shadow.c.move-default-message	2007-06-17 13:07:38.000000000 -0400
+++ gdm-2.19.3/daemon/verify-shadow.c	2007-06-18 15:15:37.000000000 -0400
@@ -127,7 +127,6 @@
 	authenticate_again:
 		/* Ask for the user's login */
 		gdm_verify_select_user (NULL);
-		gdm_slave_greeter_ctl_no_ret (GDM_MSG, _("Please enter your username"));
 		login = gdm_slave_greeter_ctl (GDM_PROMPT, _("Username:"));
 		if (login == NULL ||
 		    gdm_slave_greeter_check_interruption ()) {