--- evolution-data-server-1.12.2/libedataserverui/e-passwords.c	2007-10-12 16:29:40.000000000 +1000
+++ evolution-data-server-1.12.2-new/libedataserverui/e-passwords.c	2007-12-09 02:22:01.000000000 +1000
@@ -1084,7 +1081,8 @@
  * and for how long.
  * @remember: on input, the default state of the remember checkbox.
  * on output, the state of the checkbox when the dialog was closed.
- * @parent: parent window of the dialog, or %NULL
+ * @parent: parent window of the dialog, or %NULL to bind to the first
+ * top-level window.
  *
  * Asks the user for a password.
  *
@@ -1117,6 +1115,16 @@
 	msg->prompt = prompt;
 	msg->flags = type;
 	msg->remember = remember;
+
+	/* Ensure the dialog is bound to a top-level window. */
+	if (!parent) {
+		GList *toplevels = gtk_window_list_toplevels();
+		if (toplevels) {
+			parent = GTK_WINDOW(toplevels->data);
+			g_list_free(toplevels);
+		}
+	}
+
 	msg->parent = parent;
 
 	ep_msg_send(msg);
